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

Rename files in batch

Copy your ssh public key to a server from a machine that doesn't have ssh-copy-id
This one is a bit more robust -- the remote machine may not have an .ssh directory, and it may not have an authorized_keys file, but if it does already, and you want to replace your ssh public key for some reason, this will work in that case as well, without duplicating the entry.

Install pip with Proxy
Installs pip packages defining a proxy

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

auto complete arguments
Use it for command like : mkdir, chown, ls, less...

One liner to parse all epubs in a directory and use the calibre ebook-convert utility to convert them to mobi format
all ebook-convert -options are optional. all you really need to pass ebook-convert is the incoming and outgoing names, with extensions. Has been tested on Ubuntu 10.10

Compress a series of png pictures to an avi movie.
cd /path/to/your/png_pics mencoder "mf://*.png" -mf fps=2 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 then you can get a movie named output.avi.

Prints per-line contribution per author for a GIT repository
Figures out total line contribution per author for an entire GIT repo. Includes binary files, which kind of mess up the true count. If crashes or takes too long, mess with the ls-file option at the start: git ls-files -x "*pdf" -x "*psd" -x "*tif" to remove really random binary files git ls-files "*.py" "*.html" "*.css" to only include specific file types Based off my original SVN version: http://www.commandlinefu.com/commands/view/2787/prints-total-line-count-contribution-per-user-for-an-svn-repository

do 'foo' until it exits successfully, pausing in between crashes
restart a buggy script when it dies. works great for "git svn fetch", which leaks memory like a sieve and eventually dies...making you restart it.

Generate a playlist of all the files in the directory, newer first
I use this to generate a playlist with all the podcasts I listen to. Ordered from most recent to older.


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: