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

Know which version dpkg/apt considers more recent
Compares two versions with dpkg. It is not always obvious what version dpkg/apt will consider to be more recent. Operators include the following : * These treat an empty version as earlier than any version: lt le eq ne ge gt. * These treat an empty version as later than any version: lt-nl le-nl ge-nl gt-nl. * These are provided only for compatibility with control file syntax: < > >. This command doesn't output anything. It only returns with status 0 or 1, hence the echo "y" || echo "n" to get an output.

Gets the english pronunciation of a phrase
Sends a string to google tranlator, which converts it to English speech. It's possible to create a nice script to do the job for us, such as #!/bin'bash curl -A "Mozilla" "http://translate.google.com/translate_tts?tl=en&q=$1" > /tmp/speak.mp3 mplayer /tmp/speak.mp3

Examine processes generating traffic on your website
I often have to google this so I put it here for quick reference.

grep processes list avoiding the grep itself
Trick to avoid the form: grep process | grep - v grep

Get information on your graphics card on linux (such as graphics memory size)
Loop is needed if you have more then one card.

My Git Tree Command!
this creates a tree of your branch merges. very useful if you want to follow the features you add.

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"

PulseAudio: set the volume via command line
If you have more than one SINK

no more line wrapping in your terminal
works on all unices.

Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'
another method : awk '{gsub(/:/, "\n");print}'


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: