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

Meta

Meta + f - Move forward a word

Meta + b - Move backward a word

Bash Mode

TODO 待具体研究

set -o List all the modes

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

Read More