wget Commands

wget commands cheatsheet.

Download files, resume transfers and mirror sites from the terminal — the wget flags you actually use. Tap to copy.

Downloading
wget https://example.com/file.zipDownload a file to the current directory
wget -O name.zip URLDownload and save under a chosen name
wget -P ~/Downloads URLDownload into a specific directory
wget -c URLResume a partially downloaded file
wget -q URLQuiet mode with no progress output
Multiple & recursive
wget -i urls.txtDownload every URL listed in a file
wget -r https://example.com/Recursively download a site
wget -r -np URLRecursive, but don't climb to the parent directory
wget -r -l 2 URLLimit recursion to two levels deep
wget -m https://example.com/Mirror a site (recursive and timestamped)
Behaviour & throttling
wget --limit-rate=200k URLCap the download speed
wget -w 2 -i urls.txtWait two seconds between downloads
wget --tries=5 URLRetry up to five times on failure
wget -b URLDownload in the background
Headers & auth
wget --header="Authorization: Bearer TOKEN" URLSend a custom header
wget --user=name --password=pass URLDownload using HTTP auth
wget --no-check-certificate URLSkip TLS certificate validation
wget -U "Mozilla/5.0" URLSet a custom user agent

Downloading files from the terminal

wget is a no-frills downloader that's great for grabbing files, resuming interrupted transfers and mirroring sites. Unlike an interactive browser it runs unattended, so it's ideal in scripts and over SSH. For talking to APIs and sending data, curl is usually the better fit.

See also the Linux commands cheatsheet and rsync for syncing directories.

FAQ

What's the difference between wget and curl?
wget is built for downloading files and mirroring sites, and resumes and recurses easily. curl is better for APIs, sending data and setting headers. Both fetch URLs.
How do I resume an interrupted download?
Use wget -c URL. It continues from where the previous transfer stopped instead of starting over, as long as the server supports it.

More cheatsheets