Bash 快捷键
创建日期:2013-08-17 07:23 修改日期:2017-05-27 09:16:54

Ctrl

Ctrl + a - Jump to the start of the line # 如果使用screen,C-a可能会被占用,请使用C-a a

Ctrl + e - Jump to the end of the line

Ctrl + k - Delete from cursor to EOL # 从cursor处(包括光标)直接删除到行尾,很管用的命令

Ctrl + u - Delete backward from cursor # 从cursor处(不包括光标)直接删除前面所有,适合输错密码时用

Ctrl + w - Delete a word

Ctrl + c - Terminate the command

Ctrl + d - Delete char under the cursor

Ctrl + b - Move back a char

Ctrl + f - Move forward a char

Ctrl + r - Search the history backwards

Ctrl + R - Search the history with multi occurrence # ???还不明白这个和C-r的区别

Ctrl + l - Clear the screen

Ctrl + z - Suspend/Stop the command

zsh

Ctrl + q - 输入命令时临时运行一条其他命令

Bash Mode

TODO 待具体研究

set -o List all the modes

默认情况下,emacs mode 是 on,而 vi mode 是 off,可以通过set -o vi 改为vi mode

References