Read more

Bash Cheat Sheet (standard Emacs mode)

Arne Hartherz
November 03, 2010Software engineer at makandra GmbH
  • Ctrl + R Search commands you entered previously. Press Ctrl + R again to search further back, Ctrl + Shift + R searches forward again.

  • Ctrl + W Deletes from the cursor position to the left.

  • Ctrl + _ Undo. Yes, this also works with a German keyboard layout.

  • Ctrl + L Clear screen.

  • Ctrl + D Close shell. ( EOT Show archive.org snapshot , just like in many other shells.) Note: if you dove into another shell (e.g. with sudo su username) you will close it and return to the previous one.

  • !! Repeat the previous command. Can be used inside other commands, e.g.: "sudo !!" (← don't do that mindlessly!)

  • !$ Access the last argument of the previous command. Example: Check with "ls foo*" first and call "mv !$ /tmp" afterwards.

Combined commands

Ctrl + (C P O) Cancel the running command, go to the Previous command and run it.


Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Add useful keyboard shortcuts or shell commands if you think they are missing.

Note that you can also use your bash in VI mode!

Posted by Arne Hartherz to makandra dev (2010-11-03 09:54)