Penguin
Note: You are viewing an old revision of this page. View the current version.

Common Wget Options

Read URLs from an input file.

  • wget -i <input_file>

Another nice trick you can do is to use the character - instead of the input file. This means that wget will read a bunch of URLs from standard input. (Handy for pasting lots of URLs).

Help my wget download failed! how can I continue it?

  • wget -c <file to continue downloading>

Do not create a hierarchy of directories when retrieving recursively. eg : ./staz.co.nz/files/

  • -nd or --no-directories

The website I wish to download from requires a login.

  • use the --user <username> and --password <password> switches.

Specify the maximum recursion depth

  • -l <depth> or --level=<depth>''

Note : A depth of 0 doesn't behave as you might think. It is equivalent to infinite recursion.

Filter what is downloaded based on filename.

Use the accept list switch (-A <comma separated list> or --accept <comma separated list>)

Examples:

--ignore-case -A "*.jpg" will download files with the format <anything>.jpg, <anything>.Jpg, anything.JPG etc.

-A "*photo*" will download all files with a filename that includes the word photo.

-A mpg,avi,wmv will download all files with a mpg,avi or wmv extension.