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

Print out a man page
man -t manpagename gives a postscript version of said man page. You then pipe it to ls, and assuming you have cups set up, it prints in your default printer.

Ping Twitter to check if you can connect
Returns a JSON object, by connecting to the 'test' endpoint of the Twitter API. Simplest way to check if you can connect to Twitter. Output also available in XML, use '/help/test.xml' for that

Rotate a set of photos matching their EXIF data.
You need jhead package.

Extract audio track from a video file using mencoder
Extracts an MP3 encoded audio stream from an input video file.

view the system console remotely
This will view the console and assumes the screen is 80 characters wide. Use /dev/vcs2 for the next virtual console.. etc.

Display rows and columns of random numbers with awk
Displays six rows and five columns of random numbers between 0 and 1. If you need only one column, you can dispense with the "for" loop.

Get free RAM in %

tar a directory and send it to netcat
tar's directory and sends to netcat listening on port 10000 On the client end: netcat [server ip] 10000 | tar xfvz - This will send it over the network and extract it on the clients machine.

List files above a given threshold
List files above a given size threshold.

Check which files are opened by Firefox then sort by largest size.
Check which files are opened by Firefox then sort by largest size (in MB). You can see all files opened by just replacing grep to "/". Useful if you'd like to debug and check which extensions or files are taking too much memory resources in Firefox.


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: