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

Search google.com on your terminal
I found this command on a different site and thought you guy might enjoy it. Just change "YOURSEARCH" to what ever you want to search. Example, "Linux Commands"

Play 89.3 @TheCurrent and get system notifications on song changes.
Plays the mp3 stream of The Current as a background job. When you are done run: $ fg %1 then to exit Quite possible with Growl for mac I'd guess, although have not tried. Libnotify needed for notification, stream will still work otherwise

Get all upgradable deb packages in a single line
Works for debian and ubuntu based distros.

Using json.tool from the shell to validate and pretty-print

get newest jpg picture in a folder
search the newest *.jpg in the directory an make a copy to newest.jpg. Just change the extension to search other files. This is usefull eg. if your webcam saves all pictures in a folder and you like the put the last one on your homepage. This works even in a directory with 10000 pictures.

Grep log between range of minutes
Returns logs between HH:M[Mx-My], for example, between 13:40 and 13:45.

Extract all 7zip files in current directory taking filename spaces into account

Broadcast your shell thru ports 5000, 5001, 5002 ...
run 'nc yourip 5000', 'nc yourip 5001' or 'nc yourip 5002' elsewhere will produce an exact same mirror of your shell. This is handy when you want to show someone else some amazing stuff in your shell without giving them control over it.

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"

Open a file in a GTK+ dialog window
I use zenity because it's a rewrite of gdialog and also replaces gmessage and has more useful options. Using --text-info allows you to select and copy the text to your clipboard. To see a file in a list dialog: cat /etc/passwd | zenity --width 800 --height 600 --list --column Entries If you don't have zenity, you'll have to download it via apt-get install zenity, etc.


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: