Tired of pressing your arrow buttons to move around long lines in the shell? You’ll be lightning fast with these shortcuts in your toolkit.
Navigation
Ctrl + A
Go to the beginning of the lineCtrl + E
Go to the end of the lineAlt + F
Move cursor forward one wordAlt + B
Move cursor backward one word
Cut, Delete
Ctrl + U
Clears the line before the cursorCtrl + K
Clear the line after the cursorCtrl + W
Delete the word before the cursor
Paste
Ctrl + Y
Paste whatever you cut above
Others
Ctrl + L
Clears the ScreenCtrl + R
Search historyCtrl + C
Kill whats runningCtrl + D
Exit shell
In iTerm2 set:
profile -> keys -> set Esc+
for both option keys to make the Alt
combo’s work.