Bash Shortcuts For Maximum Productivity
The things he calls "bang commands" are actually "event designators" (!!, !blah), "word designators" ($) and "word modifiers" (:p).  There are links to docs for each at the bottom of this page: <a href="http://www.gnu.org/s/bash/manual/html_node/History-Interaction.html#History-Interaction" rel="nofollow">http://www.gnu.org/s/bash/manual/html_node/History-Interacti...</a><p>I use them all the time, and anyone watching over my shoulder always asks what that was.  Learn !!, !$, and a few modifiers.  You'll be glad you did.  Personally, I use !$ constantly (and variations like !-2$, which gets you the last arg from 2 commands ago).  The "h" modifier is handy, too.  It's like dirname for the word.  Consider this example, where you copy a file to some deep path, and then cd to that dir to continue working with the copy:<p><pre><code>    $ cp foo.txt /some/really/long/destination/bar.txt
    $ cd !$:h
    $ # (do more with ./bar.txt)
</code></pre>
The substitution (:s) and global substitution (:gs) modifiers are also useful:<p><pre><code>    $ echo some args
    some args
    $ !!:s/some/more
    more args
</code></pre>
(Also, note that his explanation of !* is actually incorrect.  He says it leaves off the last arg, but actually leaves out $0 (the command name).  !* is all of the previous command's arguments.)<p>Finally, one really useful thing he doesn't mention at all is brace expansion.  For example, these are equivalent:<p><pre><code>    $ cp foo.conf foo.conf.bak
    $ cp foo.conf{,.bak}
</code></pre>
<a href="http://www.gnu.org/s/bash/manual/html_node/Brace-Expansion.html" rel="nofollow">http://www.gnu.org/s/bash/manual/html_node/Brace-Expansion.h...</a>