Terminal keyboard shortcuts you should know

Some terminal keyboard shortcuts for you as power user.

Cursor position

  • [ctrl] + [a] – Go to beginning of line
  • [ctrl] + [e] – Go to end of line
  • [ctrl] + [xx] – Toggle between beginning and end of line
  • [alt] + [arrow left] – One word left
  • [alt] + [arrow right] –  One word right
  • [arrow left] – One character left
  • [arrow right] – One character right

Command History

  • [arrow up] – Previous command
  • [arrow down] – Next command
  • [ctrl] + [r] – Search in the command history
  • [ctrl] + [g] – Stop search in command history

Edit

  • [cmd] + [v] – Insert from clipboard
  • [ctrl] + [c] – Interrupt input
  • [ctrl] + [l] – Clear screen
  • [ctrl] + [d] – Delete character under the cursor
  • [ctrl] + [h] – Delete character before the cursor
  • [ctrl] + [w] – Delete word under the cursor
  • [crtl] + [u] – Delete the Line before the cursor
  • [esc] + [t] – Swap last two words before the cursor

Terminal

  • [ctrl] + [d] – Exit current terminal
  • [cmd] + [q] – Exit all terminals
  • [cmd] + [t] – New terminal tab
  • [cmd] + [shift] + [+] – Increase font size
  • [cmd] + [shift] + [-] – Decrease font size
  • [cmd] + [0] – Default font size