Commands using uniq (255)

What's this?

commandlinefu.com 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

Listing only one repository with yum
How to list just one repo with yum. First I disable all repo, second I enable just the repo that I want to list.

Securely destroy data (including whole hard disks)
GNU shred is provided by the coreutils package on most Linux distribution (meaning, you probably have it installed already), and is capable of wiping a device to DoD standards. You can give shred any file to destroy, be it your shell history or a block device file (/dev/hdX, for IDE hard drive X, for example). Shred will overwrite the target 25 times by default, but 3 is enough to prevent most recovery, and 7 passes is enough for the US Department of Defense. Use the -n flag to specify the number of passes, and man shred for even more secure erasing fun. Note that shredding your shell history may not be terribly effective on devices with journaling filesystems, RAID copies or snapshot copies, but if you're wiping a single disk, none of that is a concern. Also, it takes quite a while :)

Get your bash scripts to handle options (-h, --help etc) and spit out auto-formatted help or man page when asked!!
This will make your bash scripts better!! process-getopt is a wrapper around getopt(1) for bash that lets you define command line options (eg -h, --help) and descriptions through a single function call. These definitions are then used in runtime processing of command line options as well as in generating help and man pages. It also saves a little time in coding and in producing nicely formatted documentation. It is quite similar to GNU's argp in glibc for compiled languages and OptionParse for python. See: Linux Gazette article 162: http://tldp.org/LDP/LGNET/162/hepple.html, http://sourceforge.net/projects/process-getopt, http://bhepple.freeshell.org/oddmuse/wiki.cgi/process-getopt

Disable sending of start/stop characters
This command disable sending of start/stop characters. It's useful when you want to use incremental reverse history search forward shortcut (Ctrl+s). To enable again, type: $ stty -ixoff

check web server port 80 response header

Rename all files in a directory to the md5 hash

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

List available upgrades from apt (package names only)
Usefull if you only want to see the package names, or if you want to use them in a script.

Find the package that installed a command

Changing the terminal title to the last shell command
You can set the previous bash command as the terminal title by this command. Explanation: -trap assigns a command to execute at a given bash signal. -in the $BASH_COMMAND you find the last command -you can set the terminal title with the escape sequence: \e]0;this is the title\007 -to let the echo care about the backslashes give the -e to it Since trap is a built in bash command you find more informatin in 'man bash'for more Source: http://www.davidpashley.com/articles/xterm-titles-with-bash.html


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: