Use these shortcuts instead of holding Backspace to nuke a wrong command and you’ll move much faster.
Deleting text
| Shortcut |
Action |
| Delete |
Previous character (Backspace) |
| Fn + Delete |
Next character |
| Ctrl + W |
Previous word |
| Option + D |
Next word (Terminal settings require “Use Option as Meta key” enabled) |
| Ctrl + K |
From cursor to end of line |
| Ctrl + U |
From cursor to start of line |
Moving the cursor
| Shortcut |
Action |
| Ctrl + A |
Start of line |
| Ctrl + E |
End of line |
| Option + Left Arrow |
Backward one word |
| Option + Right Arrow |
Forward one word |
| Left Arrow |
Backward one character |
| Right Arrow |
Forward one character |
Other handy ones
| Shortcut |
Action |
| Ctrl + L |
Clear screen |
| Ctrl + C |
Cancel current command |
| Ctrl + T |
Transpose two characters around cursor |
| Ctrl + _ |
Undo last line edit |
All in one place
| Shortcut |
Action |
| Delete |
Delete previous character |
| Fn + Delete |
Delete next character |
| Ctrl + W |
Delete previous word |
| Option + D |
Delete next word |
| Ctrl + K |
Delete from cursor to end of line |
| Ctrl + U |
Delete from cursor to start of line |
| Ctrl + A |
Move to start of line |
| Ctrl + E |
Move to end of line |
| Option + Left Arrow |
Move backward one word |
| Option + Right Arrow |
Move forward one word |
| Left Arrow |
Move backward one character |
| Right Arrow |
Move forward one character |
| Ctrl + L |
Clear screen |
| Ctrl + C |
Cancel current command |
| Ctrl + T |
Transpose two characters around cursor |
| Ctrl + _ |
Undo last line edit |