Commands using sort (800)

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

Get simple weather info from a zip code
$ weather 97405

find files ignoring .svn and its decendents

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"

pop-up messages on a remote computer
Run this command when you are physically at the computer you wish to send pop-up messages to. Then when you ssh in to it, you can do this: echo "guess who?" > commander guess who? will then pop up on the screen for a few moments, then disappear. You will need to create the commander file first. I mess with my wife all the time with this. i.e. echo "You have given the computer a virus. Computer will be rendered useless in 10 seconds." > commander lol

Unzip and untar a *.tar.gz file in one go to a specific directory
A *.tar.gz file needs to be unzipped & then untarred. Previously I might have unzipped first with $gunzip -d file.tar.gz and then untarred the result with $tar -xvf file.tar (Options are extract, verbose, file) Using the -z (decompress) option on tar avoids the use of gzip (or gunzip) first. Additionally the -C option will specify the directory to extract to.

Replace Every occurrence of a word in a file
Replace 'this' with 'that'

Detach a process from the current shell
Continue to execute the command in background even though quitting the shell.

List packages manually installed with process currently running
Sometimes we install programs, we forget about them, and they stay there wasting RAM. This one-liner try to find them.

Convert filenames from ISO-8859-1 to UTF-8
Nothing advanced, it just finds filenames that are stored with ISO-8859-1 characters and and converts those into UTF-8. Recommended to use without the --notest flag first so you can see what will be changed.

Print the IPv4 address of a given interface


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: