All commands (14,187)

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

Create a DOS floppy image
mount with: mount -t msdos -o loop ./floppy.img /tmp/mnt

Generat a Random MAC address

Rename files in batch

Use tee to process a pipe with two or more processes
Tee can be used to split a pipe into multiple streams for one or more process to work it. You can add more " >()" for even more fun.

host - DNS lookup utility
host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command line arguments and options.

Spell check the text in clipboard (paste the corrected clipboard if you like)
xclip -o > /tmp/spell.tmp # Copy clipboard contents to a temp file aspell check /tmp/spell.tmp # Run aspell on that file cat /tmp/spell.tmp | xclip # Copy the results back to the clipboard, so that you can paste the corrected text I'm not sure xclip is installed in most distributions. If not, you can install x11-apps package

Look up the definition of a word
A bash function might also be useful: $ dict() { curl dict://dict.org/d:$1; } Or if you want less verbose output: $ dict() { curl -s dict://dict.org/d:$1 | perl -ne 's/\r//; last if /^\.$/; print if /^151/../^250/'; }

See system users

Efficiently print a line deep in a huge log file
Sed stops parsing at the match and so is much more effecient than piping head into tail or similar. Grab a line range using $ sed '999995,1000005!d' < my_massive_file

Copy data using gtar
It copies the entire current working directory to the destination directory with compression enabled.


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: