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

Rescan partitions on a SCSI device
Used this after cloning a disk with dd to make the newly written partitions show up in /dev/

Watch memcache traffic
View all memcache traffic

Get the IP address
gives u each configured IP in a seperate line.

Create md5sum of files under the current dir excluding some directories
Useful if you want get all the md5sum of files but you want exclude some directories. If your list of files is short you can make in one command as follow: $ find . -type d \( -name DIR1 -o -name DIR2 \) -prune -o -type f -exec md5sum {} \; Alternatively you can specify a different command to be executed on the resulting files.

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

Check your hard drive for bad blocks (destructive)
WARNING!!! ALL DATA WILL BE LOST!!! This command should ONLY be run on drives that are meant to be wiped. Data destruction will result from running this command with the '-w' switch. You may run this command with the '-n' switch in place of '-w' if you want to retain all data on the drive, however, the test won't be as detailed, since the '-n' switch provides a non-destructive read-write mode only, whereas '-w' switch actually writes patterns while scanning for bad blocks.

geoip information
A function that takes a domain name as an argument

Calculate days on which Friday the 13th occurs (inspired from the work of the user justsomeguy)
Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale.

How much RAM is Apache using?
Display the amount of memory used by all the httpd processes. Great in case you are being Slashdoted!

April Fools' Day Prank
Add this to a fiend's .bashrc. PROMPT_COMMAND will run just before a prompt is drawn. RANDOM will be between 0 and 32768; in this case, it'll run about 1/10th of the time. \033 is the escape character. I'll call it \e for short. \e7 -- save cursor position. \e[%d;%dH -- move cursor to absolute position \e[4%dm \e[m -- draw a random color at that point \e8 -- restore position.


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: