What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.

If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Download an entire website

Terminal - Download an entire website
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
2009-02-17 22:53:07
User: starchox
Functions: wget
Download an entire website

-p parameter tells wget to include all files, including images.

-e robots=off you don't want wget to obey by the robots.txt file

-U mozilla as your browsers identity.

--random-wait to let wget chose a random number of seconds to wait, avoid get into black list.

Other Useful wget Parameters:

--limit-rate=20k limits the rate at which it downloads files.

-b continues wget after logging out.

-o $HOME/wget_log.txt logs the output


There is 1 alternative - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

I think some builds of wget have the -m (mirror) option available as well.

Comment by joem86 363 weeks and 3 days ago

The given command does not download an entire web site. It downloads a single page, plus any images and such on that page.

For this functionality, the '-r' is not necessary, and the random wait generally isn't either.

Comment by ToyKeeper 344 weeks and 1 day ago

Ignore previous comment. Apparently the default recursion depth is now 5, which is often enough to download entire sites. However, if you want to be sure, add a '-l 0' to remove the recursion depth limit.

Comment by ToyKeeper 344 weeks and 1 day ago

From the man page, useful for offline browsing:



After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content,

such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc.

Comment by piccobello 237 weeks and 5 days ago

-p is not necessary if you're using -r

-K will keep copies of original files before modifying links with -k

-N for timestamps: useful for refreshing a mirror, only downloading new stuff

Comment by johnraff 220 weeks and 3 days ago

Your point of view

You must be signed in to comment.