Quiz Entry - updated: 2026.07.14
What are the essential bash keyboard shortcuts for cursor movement?
Bash lets you edit the command line without arrow keys: Ctrl+A/Ctrl+E jump to line start/end, Alt+B/Alt+F hop word by word, and Ctrl+U/Ctrl+K wipe to the start/end.
These come from the Emacs editing mode that bash uses by default, which is why they feel arbitrary until you learn the logic: Ctrl moves/deletes by character, Alt does the same by word. Once that clicks, fixing a typo near the front of a long command becomes one keystroke instead of twenty taps of the ← key.
| Shortcut | Action |
|---|---|
Ctrl+A |
Jump to start of line |
Ctrl+E |
Jump to end of line |
Ctrl+B / Ctrl+F |
Back / forward one character |
Alt+B / Alt+F |
Back / forward one word |
And the matching deletion keys (covered next) follow the same character-vs-word pattern.
Deletion shortcuts:
| Shortcut | Action |
|---|---|
Ctrl+U |
Delete from cursor to beginning of line |
Ctrl+K |
Delete from cursor to end of line |
Ctrl+W |
Delete word before cursor |
Alt+D |
Delete word after cursor |
Ctrl+H |
Delete character before cursor (backspace) |
Ctrl+D |
Delete character at cursor |
Mnemonic:
- A = stArt (beginning)
- E = End
- U = Unix-kill (clear to start)
- K = Kill (clear to end)
- W = Word