Keyboard shortcuts
Bash and zsh use readline
to get user input. Being familiar with the readline
shortcuts can make working with the CLI a lot more efficient.
I've omitted shortcuts that I don't currently find useful, but of course I'll revisit their utility in the future.
You might have to configure your terminal emulator to handle special keys differently than the default configuration. (TODO: figure out in detail what the necessary settings are. I believe mapping ⌥
to Esc+
is one of the required settings.)
- Moving
- Line level
^E
: go to end of line^A
: go to start of line
- Word level
⌥F
: move forward on word⌥B
: move back one word
- Line level
- Editing
- Line level
^K
: delete from cursor the rest of the line^U
: delete from start of the line to cursor
- Word level
⌥D
: delete from cursor to end of word^W
: delete from start of word to cursor
- Line level