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

List all symbolic links in current directory
With this version, you can list all symlinks in the current directory (no subdirectories), and have it list both the link and the target.

Run a command as root, with a delay
$ sleep 1h ; sudo command or $ sudo sleep 1h ; sudo command won't work, because by the time the delay is up, sudo will want your password again.

To print a specific line from a file
You can get one specific line during any procedure. Very interesting to be used when you know what line you want.

Search for a line of text in a directory of files recursively (while limiting to certain file extensions)

Open Remote Desktop (RDP) from command line having a custom screen size
This example uses xfreerdp, which builds upon the development of rdesktop. This example usage will also send you the remote machine's sound.

Finding files with different extensions
This is the way how you can find header and cpp files in the same time.

Just convert your all books DJVU format to PDF, with one line

Vectorize xkcd strips
Uses ImageMagick and potrace to vectorize the input image, with parameters optimized for xkcd-like pictures.

Batch edition of all OpenOffice.org Writer files in the current directory (body text)
This function does a batch edition of all OOO3 Writer files in current directory. It uses sed to search a FOO pattern into body text of each file, then replace it to foo pattern (only the first match) . I did it because I've some hundreds of OOO3 Writer files where I did need to edit one word in each ones and open up each file in OOO3 gui wasn't an option. Usage: bsro3 FOO foo

Delete empty directories recursively


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: