Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux wget command

Retrieve a file from a URL. Check the source before downloading or running it.

GNU Wget

Syntax

Command form
wget [OPTION]... [URL]...

Common options

7 options
OptionWhat it does
-O FILE, --output-document=FILEWrite downloaded content to FILE.
-c, --continueResume a partially downloaded file where supported.
-P DIR, --directory-prefix=DIRSave files under DIR.
-q, --quietTurn off wget output.
--spiderCheck a URL without saving its contents.
--limit-rate=RATELimit the download rate.
-r, --recursiveDownload recursively; depth and scope need care.

Usage examples

3 examples

Retrieve a file from a URL. Check the source before downloading or running it.

wget https://example.com/file.tar.gz

Check whether a URL can be reached without saving it.

wget --spider https://example.com/

Resume a partial download when the server supports it.

wget -c https://example.com/archive.tar.gz

Notes

Recursive downloads can retrieve many files. Confirm the site, scope and rate limits before using -r.