Home > bash > wget examples

wget examples

Let’s see some use cases with wget.

Download a page with http password authentication.

wget --http-user=name --http-password=password URL

Download a complete site with http password authentication. Make the copy locally browsable, i.e. convert links to point to local pages.

wget --convert-links -r --http-user=name --http-password=password URL

Collect some URLs in a file (one URL per line) and download ’em all:

wget -i file.txt

Download a page and save it under a different name:

wget http://example.com?a=1&b=2&looks_stupid=true -O simple.html

Download gallery files (requires bash, the loop is expanded by bash) [more info here]:

wget http://example.com/Tiffany/beach{01..20}.jpg

Update (20130903)

For more examples, refer to this page.

Categories: bash Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: