Networking

Linux wget command

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

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

wget [OPTION]... [URL]...

Examples

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

Parameters, options and clauses

Option / clauseDescription
-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.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory