This note is a quick reference for terminal keyboard shortcuts. These shortcuts make shell work faster and reduce the need to reach for the mouse or retype long commands.
Shell editing shortcuts
Shortcut
Purpose
Ctrl + L
clear the screen
Ctrl + U
delete from cursor back to start of line
Ctrl + A
move cursor to start of line
Ctrl + E
move cursor to end of line
Alt + B
move one word backward
Alt + F
move one word forward
Alt + .
insert the last argument from the previous command
History and control
Shortcut
Purpose
Ctrl + C
cancel the current command
Ctrl + D
exit the shell
Ctrl + R
reverse-search command history
Ctrl + P
previous command
Ctrl + N
next command
!!
repeat the previous command
Tab
autocomplete commands and paths
Copy / paste and terminal launcher
Shortcut
Purpose
Ctrl + Shift + C
copy
Ctrl + Shift + V
paste
Mod + Enter
open a new terminal
Notes
Ctrl + R becomes much more useful once your history gets longer
!! is fast, but only safe when you are sure what the previous command was
Alt + . is one of the most useful shortcuts for reusing paths and filenames