The wget command

The non-interactive network downloader. 8 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-b
Go to background immediately after startup.
-c
Continue getting a partially-downloaded file.
-i file
Read URLs from a local or external file.
-l depth
Set the maximum number of subdirectories that Wget will recurse into to depth.
-O file
The documents will not be written to the appropriate files, but all will be concatenated together and written to file.
-q
Turn off Wget's output.
-r
Turn on recursive retrieving. The default maximum depth is 5.

Examples

wget https://example.com/bigfile.zip &
wget https://example.com/file.zip
wget -O myfile.zip https://example.com/file.zip

Custom name

wget -c https://example.com/bigfile.zip

Continue download

wget -b https://example.com/file.zip
wget -i urls.txt

File containing list of URLs

wget -r -l2 https://example.com

Recursive, 2 levels deep

wget -q https://example.com/file.zip

No output

Lessons that use wget