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

Stream YouTube URL directly to mplayer
The original doesn't work for me - but this does. I'm guessing that Youtube updated the video page so the original doesn't work.

check open ports without netstat or lsof

Compute running average for a column of numbers
This is an on-line algorithm for calculating the mean value for numbers in a column. Also known as "running average" or "moving average".

list files in mtime order
Simple but useful; list files in the current directory in mtime order. Useful if you've been working on something and then take a day or two off.

Display current bandwidth statistics
ifstat, part of ifstat package, is a tool for displaying bandwidth and other statistics. The -n option avoid to display header periodically, the -t option put a timestamp at the beginning of the line. Works for me on Debian and CentOS

Create new user with home dir and given password
The crypt function takes a password, key, as a string, and a salt character array which is described below, and returns a printable ASCII string which starts with another salt. It is believed that, given the output of the function, the best way to find a key that will produce that output is to guess values of key until the original value of key is found. from http://en.wikipedia.org/wiki/Crypt_(Unix)

Echo the latest commands from commandlinefu on the console
Self-referential use of wget.

Find artist and title of a music cd, UPC code given (first result only)
I like curl better than wget, I just think that curl -s is a lot simpler than wget ... see I forget what you even have to do to get wget to pipe it's output Anyway, all in one sed command as "requested"

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

creeate file named after actual date
Create a file with actual date as filename


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: