Download an entire website

wget --random-wait -r -p -e robots=off -U mozilla
-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

By: starchox
2009-02-17 22:53:07

1 Alternatives + Submit Alt

What Others Think

I think some builds of wget have the -m (mirror) option available as well.
joem86 · 674 weeks and 1 day 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.
ToyKeeper · 654 weeks and 5 days 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.
ToyKeeper · 654 weeks and 5 days ago
From the man page, useful for offline browsing: -k --convert-links 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.
piccobello · 548 weeks and 2 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
johnraff · 531 weeks ago
I also want to get in this contest and I was hoping to get some help from your website. Now that top essay writing service I have got all the detail that I require I am sure to get participated in this contest.
NaomiJo · 42 weeks and 4 days ago
So they dug your grave and the masquerade private investigator fresno
tillyracker · 30 weeks and 2 days ago
That was interesting! Thanks for sharing this worthwhile content! Ryan for
Chaddychaddy · 22 weeks and 2 days ago
Great, I never knew the whole website can be downloaded. santa clarita drywall services
mark21 · 9 weeks and 6 days ago
seofox · 8 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? 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

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.


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: