Terminal is a program called a terminal emulator. It opens a window and lets you interact with the shell. This post covers various keyboard shortcuts which are supported in bash and zsh shell.

Key commands for both shells are similar and knowing these time-saving shortcuts can be a great boon for those using the shell often.

Navigating Line

  1. Move to the beginning of the current line
    [Ctrl][A]
  2. To move to the end of the current line
    [Ctrl[E]

Working with Words

  1. To move the cursor forward one word on the current line
    [Alt][F]
  2. Move the cursor backwards one word on the current line
    [Alt][B]
  3. Clear the characters on the line before the current cursor position
    [Ctrl][U]
  4. To clear the characters on the line after the current cursor position.
    [Ctrl][K]
  5. To delete the word in front of the cursor
    [Ctrl][W]
  6. Delete the word after the cursor
    [Alt][D]
  7. To make the current word after the cursor uppercase
    [Alt][U]
  8. To make the current word after the cursor lowercase
    [Alt][L]
    Note that cursor position here is important, if the cursor is midway in the word, only the part of the word after the cursor will have the case changed.
  9. To capitalize a word
    [Alt][C]
  1. Search history quickly
    [Ctrl][R]
    Continue pressing [Ctrl][R] to search further back in the history for all entries. When you find the one you want, press [Enter].
    If you need to modify a command that you find, use the right arrow to break out of the search and make the changes you need.