wget
Overview
wget downloads files over HTTP(S)/FTP non-interactively. Strong at recursive site mirrors and resume; for API work many prefer curl.
Syntax
wget [options] [URL...]Common Options
| Option | Description |
|---|---|
-O file |
Output name |
-c |
Continue partial |
-q |
Quiet |
-b |
Background |
-P dir |
Directory prefix |
--spider |
Check existence only |
-r |
Recursive |
-l n |
Recursion depth |
-np |
No parent |
--user-agent= |
UA string |
--header= |
Extra header |
Examples with Explanations
Simple download
wget https://example.com/file.tgz
wget -O out.tgz https://example.com/file.tgzResume
wget -c https://example.com/large.isoQuiet to directory
wget -q -P /tmp https://example.com/a.binSpider (existence)
wget --spider -S https://example.com/ 2>&1 | headRecursive limited mirror
wget -r -l 1 -np -k -p https://example.com/docs/