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 Files in a Directory with Wildcards.
If the dir | wc -l Command not working.

Sort specific lines while editing within vi
Sort lines within vi editor. In this example sort lines 33-61 and lines 4-9 asciibetically.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

search user defined function in c language

send a file or directory via ssh compressing with lzma for low trafic

Figure out what shell you're running

Display 16 largest installed RPMs in size order, largest first
Interesting to see which packages are larger than the kernel package. Useful to understand which RPMs might be candidates to remove if drive space is restricted.

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

How to sum lines with decimals in awk
Read all lines using decimal marker as point, then add all them up and outputs the result.

Show bz compressed PF binary log


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: