bash快捷键一览
命令行编辑快捷键
-
Ctrl + a 将光标定位到命令行开头位置
-
Ctrl + e 将光标定位到命令行末尾
-
Ctrl + k 从光标位置到末尾的字符删除
-
Ctrl + u 从光标位置到开头字符删除
-
Ctrl + w 从光标位置往前删除一个单词
-
Ctrl + y 粘贴(上面命令删除的单词)到光标后面
-
Ctrl + xx move between start of command line and current cursor position(and back again)
-
Alt + b move backward one word(or go to start of word the cursor is currently on)
-
Alt + f move forward one word(or go to end of word the cursor is currently on)
-
Alt + d delete to end of word starting at cursor(whole word if cursor is at the beginning of word)
-
Alt + u make uppercase from cursor to end of word
-
Alt + l make lowercase from cursor to end of word
-
Alt + t swap current word with previous
-
Ctrl + f move forward one character
-
Ctrl + b move backward one character
-
Ctrl + d delete character under the cursor
-
Ctrl + h delete character before the cursor
-
Ctrl + t swap character under cursor with the previous one
Command Control Shortcuts
-
Ctrl + l clear the screen
-
Ctrl + s stops the output to the screen(for long running verbose command)
-
Ctrl + q allow output to the screen(if previously stoped using command above)
-
Ctrl + c terminate the command
-
Ctrl + z suspend/stop the command
Command Recall Shortcuts
-
Ctrl + r search the history backwards
-
Ctrl + g escape from history searching mode
-
Ctrl + p previous command in history
-
Ctrl + n next command in history