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

Eavesdrop on your system
This command takes a snapshot of the open files for a PID 1234 then waits 10 seconds and takes another snapshot of the same PID, it then displays the difference between each snapshot to give you an insight into what the application is doing.

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

list processes with established tcp connections (without netstat)
Uses lsof to list open network connections (file descriptors), grepping for only those in an established state

Command line calculator
This function defines a command line calculator that handles everything pythons math module can handle, e.g. trigonometric functions, sqrt, log, erf, ... (see http://docs.python.org/library/math.html). It even knows about the constants pi and e.

find files beginning with filename* that do not include "string"
Inverse grep, to find files without the string

Sum columns from CSV column $COL

Print a great grey scale demo !
Seen here: http://www.pixelbeat.org/docs/terminal_colours/

Screencast with ffmpeg x11grab
requires ffmpeg & xwininfo to be installed replace hw:0,0 with pulse if you like using pulseaudio press q to quit

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"

Edit the Last Changed File


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: