Terminal keyboard shortcuts

Common

  • Command-Z: Undo the last change, supported in Bash and Zsh
  • Command-Right Click: (Or middle mouse click, if any) Paste last selected string

Meta Key

Meta key supports require Core Shell 2.2 and later, coming soon…

Bash / Zsh

Moving the Cursor

  • Control-A or Home: Beginning of line
  • Control-E or End: End of line
  • Control-F: Forward one character
  • Control-B: Back one character
  • Option-Left Arrow or Meta-B: Back one word
  • Option-Right Arrow or Meta-F: Forward one word
  • Control-XX: Move between the beginning of the line and the current cursor position. This allows you to press Control-XX to return to the start of the line, change something, and then press Control-XX to go back to your original cursor position. To use this shortcut, hold the Control key and tap the X key twice.

Delete Text

  • Option-Delete or Meta-Delete: Delete the Word before the cursor
  • Meta-D: Delete the Word after the cursor
  • Control-D: Delete the character under the cursor
  • Control-H or Delete: Delete one character (backw­ards)

Cutting and Pasting

  • Option-Delete or Control-W: Cut one word (backwards), adding it to the clipboard
  • Control-K: Cut to end of line, adding it to the clipboard
  • Control-U: Cut to beginning of line, adding it to the clipboard
  • Control-Y: Paste the last text you cut from the clipboard (yank)

Capitalizing Characters

  • Meta-U: Upper capitalize every character from the cursor to the end of the current word
  • Meta-L: Lower the case of every character from the cursor to the end of the current word
  • Meta-C: Capitalize the character under the cursor and move to the end of the word.

Fixing Typos

  • Control- _: Undo the last change
  • Meta-T: Swap current word with previous
  • Control-T: Swap the last two characters before the cursor

Tab Completion

  • Tab : Automatically complete the file, directory, or command you’re typing

History Search

Press Control-R to search through the history. Continue pressing Control-R until you find the entry you're looking for. Press Enter to execute the current expression. Press Right Arrow to modify the current expression. Press Control-G to escape from search mode.

Screen Control

  • Control-L: Clear screen
  • Control-S: Stop output to screen (for long running verbose commands)
  • Control-Q: Re-enable screen output

Process Control

  • Control-C: Kill current process
  • Control-D: Exit shell
  • Control-Z: Suspend process