Copied from the readline documentation.
For MacOS, replace Ctrl
with Cmd
, and Meta
with Option
.
Shortcut | Comment |
---|---|
Ctrl +A |
Beginning of line |
Ctrl +B / ← |
Backward one character |
Meta +B |
Backward one word |
Ctrl +C |
Send io.EOF |
Ctrl +D |
Delete one character |
Meta +D |
Delete one word |
Ctrl +E |
End of line |
Ctrl +F / → |
Forward one character |
Meta +F |
Forward one word |
Ctrl +G |
Cancel1 |
Ctrl +H |
Delete previous character |
Ctrl +I / Tab |
Command line completion |
Ctrl +J |
Line feed |
Ctrl +K |
Kill2 text to the end of line |
Ctrl +Y |
Yank3 text back onto command line |
Ctrl +L |
Clear screen |
Ctrl +M |
Same as Enter key |
Ctrl +N / ↓ |
Next line (in history) |
Ctrl +P / ↑ |
Prev line (in history) |
Ctrl +R |
Search backwards in history |
Ctrl +S |
Search forwards in history |
Ctrl +T |
Transpose characters |
Meta +T |
Transpose words |
Ctrl +U |
Kill text to the beginning of line |
Ctrl +W |
Kill previous word |
Backspace |
Delete previous character |
Meta +Backspace |
Kill previous word |
Enter |
Line feed |
Ctrl +_ |
Undo edits |
Footnotes
-
Same as Escape ↩
-
Killing text means to delete the text from the line, but to save it away for later use, usually by yanking (re-inserting) it back into the line. (‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.) ↩
-
Yanking means to copy the most-recently-killed text from the kill buffer ↩