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

Bash function that saves bash functions to file from shell session
The simpler, 1-arg version is save_function(){ { date +"# %F.%T $1; declare -f "$1";}| tee -a ~/.bash_functions; }`

Get Unique Hostnames from Apache Config Files
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.

Run a command when a file is changed

Geolocate a given IP address

Compare copies of a file with md5
I had the problem that the Md5 Sum of a file changed after copying it to my external disk. This unhandy command helped me to fix the problem.

Get your external IP address if your machine has a DNS entry

analyze traffic remotely over ssh w/ wireshark
When using tcpdump, specify -U option to prevent buffering.

Commandline document conversion with Libreoffice
In this example, the docx gets converted to Open Document .odt format. For other formats, you'll need to specify the correct filter (Hint: see "Comments" link below for a nice list).

Best SSH options for X11 forwarding
grabbed from: http://blog.samat.org/2006/05/08/best-ssh-options-for-x11-forwarding

Analyze awk fields
Breaks down and numbers each line and it's fields. This is really useful when you are going to parse something with awk but aren't sure exactly where to start.


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: