mac - common key shortcuts and terminal operations

terminal key shortcuts:

  • Ctrl + a – go to the start of the command line
  • Ctrl + e – go to the end of the command line
  • Ctrl + k – delete from cursor to the end of the command line
  • Ctrl + u – delete from cursor to the start of the command line
  • Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
  • Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor

terminal operations:

1. open google chrome from terminal

If you just want to open the Google Chrome from terminal instantly for once then open -a "Google Chrome" works fine from Mac Terminal.

If you want to use an alias to call Chrome from terminal then you need to edit the bash profile and add an alias on ~/.bash_profile or ~/.zshrc file.The steps are below :

  • Edit ~/.bash_profile or ~/.zshrc file and add the following line alias chrome="open -a 'Google Chrome'"
  • Save and close the file.
  • Logout and relaunch Terminal or source ~/.bash_profile
  • Type chrome filename for opening a local file.
  • Type chrome url for opening url.

2. Atom open file from terminal

$ Atom .bash_profile

references:

1. https://*.com/questions/34796888/how-to-open-google-chrome-from-terminal

2. https://skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

上一篇:(二)微信开发工具


下一篇:微信二次分享