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

What is my public IP-address?
Very effective, use only DNS protocol. The @ part is optional if you already set opendns servers as default ns servers.

Get sunrise and sunset times
This will get the sunrise and sunset times of a specific location. To be able to determine $l you need to first go to http://weather.yahoo.com/ and look up your location. The last numbers in the URL will be the $l Instead of forecastrss?w=$l you can also use forecastrss?p=$l and use the RSS link of the city you found. Also see http://developer.yahoo.com/weather/ for more information

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Export unpushed files list

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

Extract shortcuts and hostnames from .ssh/config
Spits out table that shows your Host->HostName aliases in ~/.ssh/config

Remove newlines from output
Remove newlines from output. One character shorter than awk /./ filename and doesn't use a superfluous cat. To be fair though, I'm pretty sure fraktil was thinking being able to nuke newlines from any command is much more useful than just from one file.

See OpenVZ Container id's of top 10 running processes by %cpu
This command will list the PID, VEID, and Name of the 10 highest cpu using processes on a openvz host. You must have vzpid installed.

Count Files in a Directory with Wildcards.
Remove the '-maxdepth 1' option if you want to count in directories as well

Takes and displays screenshot of Android phone over adb.
Dependencies on phone: adb access, screencap command, base64 command. Dependencies on computer: adb, sed, base64, display (from imagemagick, but can substitute other image viewer which reads from stdin). This should work around adb stupidies (i.e. that it replaces \n with \r\n) with base64.


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: