Commands tagged bang (2)

  • Bash's history expansion character, "!", has many features, including "!:" for choosing a specific argument (or range of arguments) from the history. The gist is any number after !: is the number of the argument you want, with !:1 being the first argument and !:0 being the command. See the sample output for a few examples. For full details search for "^HISTORY EXPANSION" in the bash(1) man page.    Note that this version improves on the previous function in that it handles arguments that include whitespace correctly. Show Sample Output

    hackerb9 · 2013-09-15 03:41:13 7
  • Seems obvious, but other seemingly simple ways to use it don't work: echo !whammy and echo "!whammy" both output: -bash: !whammy: event not found and this: echo "\!whammy" outputs: \!whammy with the slash :( you can also do any combinations of quotes for a complex string: echo "It's great to be able to use a bang ("'!'") in a command"'!' outputs: It's great to be able to use a bang (!) in a command! Show Sample Output

    echo '!'whammy
    sudopeople · 2009-03-26 23:34:33 9

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

list block devices
Shows all block devices in a tree with descruptions of what they are.

Run the last command as root
this command also can run the last command as root what's more, sudo !-2 can run the second last command as root , and so on

Monitor progress of a command
Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion. Source:

Top 10 Memory Processes
It displays the top 10 processes sorted by memory usage

Binary digits Matrix effect
Silly Perl variant.

Remove Suspend option from XFCE logoff dialog

Sum size of files returned from FIND

Dump snapshot of UFS2 filesystem, then gzip it
Opens a snapshot of a live UFS2 filesystem, runs dump to generate a full filesystem backup which is run through gzip. The filesystem must support snapshots and have a .snap directory in the filesystem root. To restore the backup, one can do $ zcat /path/to/adXsYz.dump.gz | restore -rf -

Get the full path to a file
Part of coreutils - so needs no extra package...

Combine multiple images into a video using ffmpeg
The -start_number can be ignored if sequence starts with 0, otherwise use first number in sequence

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: