Readline key mapping
Readline is the terminal library used by bash and other applications to manage the interactive command line interface. The default key mappings are shown here.
Keystrokes | Effect |
---|---|
Movement | |
Ctrla | Move cursor to start of line |
Ctrle | Move cursor to end of line |
Ctrlxx | Toggle cursor between current and previous positions |
Altb | Move back to start of current/preceding word |
Altf | Move forward to after end of current/next word |
Ctrlb | Move back one character |
Ctrlf | Move forward one character |
Editing | |
Ctrlk | Delete to end of line |
Ctrlu | Delete to start of line |
Altd | Delete to end of word |
Ctrlw | Delete back to start of word |
Ctrld | Delete character at cursor — like Delete |
Ctrlh | Delete character before cursor — like BackSpace |
Ctrly | Paste |
Altu | Uppercase to end of word |
Altl | Lowercase to end of word |
Altc | Capitalise to end of word |
Altt | Swap word with previous |
Ctrlt | Swap character with previous |
Ctrlxe | Edit the line with $EDITOR |
Ctrlxu | Undo the last edit operation |
Ctrl_ | Undo the last edit operation |
Altr | Undo all edit operations |
History | |
Ctrlr | Search iteratively back through history for substring |
Ctrlr | Search iteratively back through history for substring |
Ctrlg | Abort history search |
Ctrlp | Previous history entry |
Ctrln | Next history entry |
Alt. | Insert last word of previous line |
Miscellaneous | |
Ctrll | Clear terminal screen |
Ctrlv | Escape following control sequence |
Ctrlxv | Display bash version |
Ctrlxr | Re-read .inputrc |