wget Cheatsheet - Download Command

wget is the most reliable command-line downloader, especially for scripts and unattended runs: -c resumes after interruption, --retry retries automatically, -b runs in the background, and -r mirrors a site recursively. This table covers these high-frequency combos so interrupted downloads restart from where they broke.

SysOps·38 commands·Last updated 2026-07-21
wgetDownloadlinux

Basic Download 7

wget URL
Download a file to the current directory
wget -O filename URL
Download and save as a given name
wget -P /path/to/dir URL
Download to a given directory
wget -b URL
Download in the background
wget -q URL
Quiet download (no progress)
wget -v URL
Verbose output
wget -nc URL
Skip existing files (no-clobber)

Resume 3

wget -c URL
Resume a partial download
wget -c -O filename URL
Resume and save as a given name
wget --continue URL
Resume (same as -c)

Recursive 8

wget -r URL
Recursive download (default depth 5)
wget -r -l 2 URL
Recursive, depth 2
wget -r -np URL
Recursive, no parent directories
wget -r -nd URL
Recursive, no directory structure
wget -r -N URL
Recursive, newer files only
wget -m URL
Mirror a site (equiv. -r -N -l inf --no-remove-listing)
wget --mirror URL
Mirror a site (same as -m)
wget -r -H -D example.com URL
Cross-host but limit to a domain (-H host, -D domain)

Filter 6

wget -A "*.pdf,*.doc" URL
Download only given types
wget -R "*.tmp,*.log" URL
Reject given types
wget --accept-regex ".*\.pdf$" URL
Accept by regex
wget --reject-regex ".*\.tmp$" URL
Reject by regex
wget -I /dir1,/dir2 URL
Download only given directories
wget -X /dir1,/dir2 URL
Exclude given directories

Auth & Proxy 6

wget --user=username --password=pass URL
HTTP authentication
wget --ftp-user=user --ftp-password=pass URL
FTP authentication
wget -e use_proxy=yes -e http_proxy=URL
Use an HTTP proxy
wget -e use_proxy=yes -e https_proxy=URL
Use an HTTPS proxy
wget --no-check-certificate URL
Skip SSL certificate verification
wget --user-agent="Mozilla/5.0" URL
Custom User-Agent (bypass UA checks)

Common Patterns 8

wget -i urls.txt
Download from a list of URLs
wget -r -l 1 -A "*.jpg,*.png" URL
Download all images on a page
wget -r -l 1 --convert-links URL
Download and rewrite links to local
wget -r -l 1 -k -E -p URL
Download a full page (images, CSS, JS)
wget --limit-rate=100k URL
Limit download speed
wget --timeout=30 --tries=3 URL
Set timeout and retry count
wget --spider URL
Check only, don't download (link test)
wget -w 2 --random-wait -r URL
Polite crawl: 2s wait plus random jitter

Tips

  • wget supports HTTP, HTTPS and FTP, with resume and recursive download.
  • Mind the depth (-l) on recursive downloads to avoid pulling too many files.
  • Use -m to mirror a site; it auto-handles link conversion and timestamps.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us