Being handy on a terminal can be an enormous productivity boost and will make you feel like a proper hacker (as long as you’re typing in green on a black background).
Bash is by far the most popular shell available on Linux based systems, packed with extensive customization options for any environment. In this post, I’ll line up some of the shortcuts that’ll make your life quite a bit easier.
Copying and pasting on command line
This one isn’t actually bash specific, but will work on basically any terminal emulator such as PuTTY or Xterm.
Go to beginning of line:
Go to end of line:
Delete last word:
Kill a running command:
Move current process from running to sleeping state (mnemonic: zzz):
After executing previous command, you can get it running again either in foreground or background by issuing the fg or bg command. In the latter case you’ll regain control of the terminal.
This is equivalent to typing exit, and is considered a “clean” exit and as such will not prompt a confirmation box.
To quickly search in your history (instead of spamming the up arrow), simply use:
And start typing the part of the command you remember. Be careful as pressing enter will execute the command in your history immediately.