Terminal

Summary

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

ShortcutPurpose
Ctrl + Lclear the screen
Ctrl + Udelete from cursor back to start of line
Ctrl + Amove cursor to start of line
Ctrl + Emove cursor to end of line
Alt + Bmove one word backward
Alt + Fmove one word forward
Alt + .insert the last argument from the previous command

History and control

ShortcutPurpose
Ctrl + Ccancel the current command
Ctrl + Dexit the shell
Ctrl + Rreverse-search command history
Ctrl + Pprevious command
Ctrl + Nnext command
!!repeat the previous command
Tabautocomplete commands and paths

Copy / paste and terminal launcher

ShortcutPurpose
Ctrl + Shift + Ccopy
Ctrl + Shift + Vpaste
Mod + Enteropen 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