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

Length of longest line of code
Here's an awk version.

Job Control
background and disown, but with a proper one-line syntax

Monitor bandwidth by pid
Nethogs is a useful tool for monitor bandwidth consumption by pid. Tested on Debian an CentOs

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"

Determining the excat memory usages by certain PID
this command gives you the total number of memory usuage and open files by the perticuler PID.

NSA codename generator
nsacodenamegenerator dot com is no more outputs random two words together in capital letters

Kill any lingering ssh processes

Convert camelCase to underscores (camel_case)
Useful for switching over someone else's coding style who uses camelCase notation to your style using all lowercase with underscores.

List the biggest accessible files/dirs in current directory, sorted

Debug a remote php application (behind firewall) using ssh tunnel for XDEBUG port 9000
If you need to xdebug a remote php application, which is behind a firewall, and you have an ssh daemon running on that machine. you can redirect port 9000 on that machine over to your local machine from which you run your xdebug client (I am using phpStorm) So, run this command on your local machine and start your local xdebug client, to start debugging. more info: http://code.google.com/p/spectator/wiki/Installing


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: