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

Install pip with Proxy
Installs pip packages defining a proxy

Change your swappiness Ratio under linux
This command allow you to set the swappiness var at 50 (default is 60). The value interval must be set between 0 and 100. If swappiness is high=Swap usage is high, if swappiness is low=Ram usage is high.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Get your Tweets from the command line
Gets the latest Tweets in your friends timeline from Twitter. Uses curl and xmlstarlet.

find which lines in a file are longer than N characters
Filter out lines of input that contain 72, or fewer, characters. This uses bash only. ${#i} is the number of characters in variable i.

Find files and calculate size of result in shell
Find files and calculate size with stat of result in shell

translate what is in the clipboard in english and write it to the terminal

Print all open regular files sorted by the number of file handles open to each.
This command run fine on my Ubuntu machine, but on Red Hat I had to change the awk command to `awk '{print $10}'`.

Protect directory from an overzealous rm -rf *
Forces the -i flag on the rm command when using a wildcard delete.

clear the X clipboard
Clears your clipboard if xsel is installed on your machine. If your xsel is dumb, you can also use $xsel --clear --clipboard


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: