TTY 快捷键


快捷键 描述 注意事项
删除行左 不适用于 Linux、Mac 和 Windows
删除行右 不适用于 Mac
触发 SIGINT 或关闭逐行读取实例
删除左边
如果当前行为空或 EOF,则向右删除或关闭逐行读取实例 不适用于 Windows
从当前位置删除到行首
从当前位置删除到行尾
转到行首
转到行尾
后退一个字符
前进一个字符
清屏
下一个历史子项
上一个历史子项
将正在运行的进程移到后台。 不适用于 Windows
向后删除到单词边界
向前删除到单词边界 不适用于 Mac
左边的单词
右边的单词
删除右边的单词
删除左边的单词 不适用于 Mac
Keybindings Description Notes
ctrl + shift + backspace Delete line left Doesn't work on Linux, Mac and Windows
ctrl + shift + delete Delete line right Doesn't work on Mac
ctrl + c Emit SIGINT or close the readline instance
ctrl + h Delete left
ctrl + d Delete right or close the readline instance in case the current line is empty / EOF Doesn't work on Windows
ctrl + u Delete from the current position to the line start
ctrl + k Delete from the current position to the end of line
ctrl + a Go to start of line
ctrl + e Go to to end of line
ctrl + b Back one character
ctrl + f Forward one character
ctrl + l Clear screen
ctrl + n Next history item
ctrl + p Previous history item
ctrl + z Moves running process into background. Type fg and press enter to return. Doesn't work on Windows
ctrl + w or ctrl + backspace Delete backward to a word boundary ctrl + backspace Doesn't work on Linux, Mac and Windows
ctrl + delete Delete forward to a word boundary Doesn't work on Mac
ctrl + left or meta + b Word left ctrl + left Doesn't work on Mac
ctrl + right or meta + f Word right ctrl + right Doesn't work on Mac
meta + d or meta + delete Delete word right meta + delete Doesn't work on windows
meta + backspace Delete word left Doesn't work on Mac