Useful Keyboard Shortcuts for Bash

When you manage a dedicated server, you will almost certainly spend a considerable amount of time working from the command line, probably via SSH. If so, you will encounter Bash or a shell similar to it. While you can accomplish pretty much anything with various commands, you can increase efficiency by learning some of the common Bash shortcuts. The following are a few of the useful shortcuts you should learn.

  • Ctrl+A – Takes you to the beginning of the current line
  • Ctrl+E – Takes you to the end of the current line
  • Ctrl+D – Exits the current shell
  • Ctrl+W – Deletes the word before the cursor
  • Ctrl+K – Deletes the word after the cursor
  • Ctrl+L – Clears the screen of all text
  • Ctrl+C – Kills the current active process
  • Ctrl+Z – Pushes the current active process into a suspend background process
  • Ctrl+U – Clears any text in the line before the cursor
  • Ctrl+R – provides a search interface for previously executed commands

Not all of these will work in SSH, so you may need to do some experimenting. It should also be noted that these are usually the default shortcuts for Linux, but they may differ depending on your distribution.