mac - common key shortcuts and terminal operations

本文介绍了终端中常用的快捷键,如Ctrl+a、Ctrl+e等,用于快速导航和编辑命令行输入。此外,还详细讲解了如何从终端打开Google Chrome浏览器及Atom编辑器的方法,包括设置别名和使用快捷命令。

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

 

Atom shortcuts

atom-shortcuts

 

vim keyshort see Vim Cheat Sheet here, note cursor movement is not in insert mode.

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/

3. https://atom.io/packages/atom-shortcuts

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值