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

rotate a one page pdf to 90 Degrees Clockwise
This can be taken from the pdftk docs http://www.pdflabs.com/docs/pdftk-man-page/ http://www.pdflabs.com/docs/pdftk-cli-examples/ , but the command examples are not simple.

list folders containing less than 2 MB of data
Just shortened the awk a bit and removed sed. Edit: I'm assuming there are no spaces in the path. To support white space in pathname try: $ awk '($1 < 2048) {sub(/^[0-9]+[ \t]+/,""); print $0}'

Install pip with Proxy
Installs pip packages defining a proxy

Watch the progress of 'dd'
Only slightly different than previous commands. The benefit is that your "watch" should die when the dd command has completed. (Of course this would depend on /proc being available)

Test load balancers
With the "--resolve" switch, you can avoid doing DNS lookups or edit the /etc/hosts file, by providing the IP address for a domain directly. Useful if you have many servers with different IP addresses behind a load balancer. Of course, you would loop it: $ for IP in 10.11.0.{1..10}; do curl --resolve subdomain.example.com:80:$IP subdomain.example.com -I -s; done

Convert df command to posix; uber GREPable
It is a pain grep-ing/sed-ing/awk-ing plain old df. POSIX it!

Show this month's calendar, with today's date highlighted
Explanation: * The date command evaluated to today's date with blank padded on the left if single digit * The grep command search and highlight today's date * The --before-context and --after-context flags displays up to 6 lines before and after the line containing today's date; thus completes the calendar. I have tested this command on Mac OS X Leopard and Xubuntu 8.10

How To Get the Apache Document Root

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

make a log of a terminal session
Creates a log of a session in a file called typescript. Or specify the file with: $script filename Exit the session with control-d.


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: