Last Updated: February 25, 2016
·
1.535K
· iltempo

Bang commands in shell

Bang commands are helpful to repeat shell commands recorded in the history. You probably know about the CMD + r interactive history search. With bang commands you can be faster.

Bang commands I often use are for example:

!ssh - the most recent ssh command

bundle exec !! - the most recent command in bundler environment

Find a more extensive list here:
http://www.softpanorama.org/Scripting/Shellorama/bash_command_history_reuse.shtml