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

Count the number of queries to a MySQL server

Convert "man page" to text file
You can convert any UNIX man page to .txt

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Convert Squid unixtime logs in human-readable ones
On-the-fly conversion of Unix Time to human-readable in Squid's access.log

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by EVACopy http://evacopy.sourceforge.net

pipe output to notify-send
Route output to notify-send to show nice messages on the desktop, e.g. title and interpreter of the current radio stream

Change every instance of OLD to NEW in file FILE
Very quick way to change a word in a file. I use it all the time to change variable names in my PHP scripts (sed -i 's/$oldvar/$newvar/g' index.php)

Find broken symlinks in the current directory and its subdirectories.
This is best run as root to avoid permission denials that can produce false positives. Obviously you can specify a directory in the usual way: $ find -L dirname -type l I can't remember where I read about this or who deserves the credit for it. The find(1) manual page hints strongly toward it, however.

list process ids for given program

Binary clock
Fun idea! This one adds seconds and keeps running on the same line. Perl's probably cheating though. :)


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: