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

Play all files in the directory using MPlayer
Skip forward and back using the < and > keys. Display the file title with I.

Print interface that is up and running

regex for turning a URL into a real hyperlink (i.e. for posting somewhere that accepts basic html)
This should work with anything://url.whatever etc etc ;)

List the size (in human readable form) of all sub folders from the current location
Simple and easy to remember. -h is human, -d1 = depth 1. disk usage, human, depth 1

Backup (archive) your Gmail IMAP folders.
Copies an entire hierarchy of mailboxes from the named POP3/IMAP/etc. source to the named destination. Mailboxes are created on the destination as needed. NOTE: The 'mailutil' is Washington's University 'mailutil' (apt-get install uw-mailutils). More examples $ mailutil transfer {imap.gmail.com/ssl/user=you@gmail.com}INBOX Gmail/ ; mailutil check imap.gmail.com/ssl/user=you@gmail.com}\[Gmail\]/Spam If you use the utility in the first, append -v|-d flag(s) to the end the commands above (man mailutil).

Convert all files for iPhone with HandbrakeCLI

Determine an image's dimensions
Simple use of ImageMagick identify function.

Grep auth log and print ip of attackers
Work for me on CentOS, grep and print ip addresses of ssh bruteforce attempts

First pass dvd rip... The set of commands was too long, so I had to separate them into two.
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000) Enjoy!

Use a var with more text only if it exists
See "Parameter Expansion" in the bash manpage. They refer to this as "Use Alternate Value", but we're including the var in the at alternative.


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: