mac - common key shortcuts and terminal operations

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangbingfengf98/article/details/89301061

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://stackoverflow.com/questions/34796888/how-to-open-google-chrome-from-terminal

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

猜你喜欢

转载自blog.csdn.net/wangbingfengf98/article/details/89301061