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 directorywget -O name.zip URLDownload and save under a chosen namewget -P ~/Downloads URLDownload into a specific directorywget -c URLResume a partially downloaded filewget -q URLQuiet mode with no progress outputMultiple & recursive
wget -i urls.txtDownload every URL listed in a filewget -r https://example.com/Recursively download a sitewget -r -np URLRecursive, but don't climb to the parent directorywget -r -l 2 URLLimit recursion to two levels deepwget -m https://example.com/Mirror a site (recursive and timestamped)Behaviour & throttling
wget --limit-rate=200k URLCap the download speedwget -w 2 -i urls.txtWait two seconds between downloadswget --tries=5 URLRetry up to five times on failurewget -b URLDownload in the backgroundHeaders & auth
wget --header="Authorization: Bearer TOKEN" URLSend a custom headerwget --user=name --password=pass URLDownload using HTTP authwget --no-check-certificate URLSkip TLS certificate validationwget -U "Mozilla/5.0" URLSet a custom user agentDownloading 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.