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

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

Compare a remote dir with a local dir
You can compare directories on two different remote hosts as well: $ diff -y

View the latest astronomy picture of the day from NASA.
Substitute feh for the image viewer of your choice. display (part of imagemagick) seems to be a popular choice.

Find Mac address

how to find the active X (X11/xorg) username and DISPLAY variable
Requires consolekit (works in e.g. Ubuntu). Here x11-display is DISPLAY

Count the number of deleted files
It does not work without the verbose mode (-v is important)

Create patch file for two directories

Downmix first audio stream from 7.1 to 5.1 keeping all other streams
Useful for Roku which does not support 7.1. Useful resources: - https://trac.ffmpeg.org/wiki/Map - https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio - https://superuser.com/questions/852400/properly-downmix-5-1-to-stereo-using-ffmpeg

start a tunnel from some machine's port 80 to your local post 2001
now you can acces the website by going to http://localhost:2001/

Delete C style comments using vim


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: