Skip to main content

wget command

Detailed Explanation

GNU wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. "Non-interactive" means it can work in the background, while the user is not logged on, allowing you to start a retrieval and disconnect from the system.

Basic Syntax

wget [option]... [URL]...

Common Flags/Options

OptionDescription
-O <file>Write documents to <file>.
-c, --continueResume getting a partially-downloaded file.
-q, --quietQuiet (no output).
-r, --recursiveSpecify recursive download (download a whole directory/website).
--limit-rate=<rate>Limit download rate (e.g., 50k, 1m).
-i <file>Read URLs from a local or external file.

Real-world Examples

Download a single file:

wget https://example.com/file.iso

Resume an interrupted download:

wget -c https://example.com/large_file.iso

Download a file and save it under a different name:

wget -O new_name.zip https://example.com/old_name.zip

Download all URLs listed in a file:

wget -i urls.txt

Mirror a website (recursive download):

wget -r -p -k -E https://example.com