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

Close specify detached screen
-X Send the specified command to a running screen session. -S Option to specify the screen session if you have several screen sessions running. $screen -ls for listing current screens and its sessionname

Install pip with Proxy
Installs pip packages defining a proxy

ZSH prompt. ':)' after program execution with no error, ':(' after failure.
sorry for my english

Find and delete oldest file of specific types in directory tree
This works on my ubuntu/debian machines. I suspect other distros need some tweaking of sort and cut. I am sure someone could provide a shorter/faster version.

mercurial close branch

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

Insert a line for each n lines
specially usefull for sql scripts with insert / update statements, to add a commit command after n statements executed.

Recursively remove 0kb files from a directory

Get Lorum Ipsum random text from lorumipsum.com
This will generate 3 paragraphs with random text. Change the 3 to any number.

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"


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: