Networking
wget CLI
wget commands for downloading files and mirroring websites.
28 commands
Windows
MacOS
Linux
#download
#http
Basic Downloads
Download a single file
wget https://example.com/file.tar.gz
Save with a custom filename
wget -O output.html https://example.com/page
Download silently without progress
wget -q https://example.com/file.zip
Download all URLs listed in a file
wget -i urls.txt
Save to a specific directory
wget -P /tmp/downloads https://example.com/file.zip
Download in background
wget -b https://example.com/large.iso
Recursive Download
Recursively download a directory
wget -r https://example.com/docs/
Limit recursion to 2 levels deep
wget -r -l 2 https://example.com/
Stay within the parent directory
wget -r --no-parent https://example.com/docs/
Download only PDF files recursively
wget -r -A '*.pdf' https://example.com/docs/
Exclude image files from download
wget -r --reject '*.png,*.jpg' https://example.com/
Authentication
HTTP basic authentication
wget --user=admin --password=secret https://example.com/file
Prompt for password interactively
wget --http-user=admin --ask-password https://example.com/file
Use a custom auth header
wget --header='Authorization: Bearer TOKEN' https://api.com/
Use client certificate for TLS
wget --certificate=client.pem https://secure.example.com/
Bandwidth & Resume
Resume a partially downloaded file
wget -c https://example.com/large.iso
Limit download speed to 500 KB/s
wget --limit-rate=500k https://example.com/file.zip
Retry up to 5 times on failure
wget -t 5 https://example.com/file.zip
Set connection timeout to 30 seconds
wget --timeout=30 https://example.com/file.zip
Wait 2 seconds between requests
wget -w 2 -r https://example.com/
Mirroring
Mirror an entire website
wget --mirror https://example.com/
Mirror and fix links for offline use
wget --mirror --convert-links https://example.com/
Mirror a subdirectory with assets
wget --mirror --no-parent --page-requisites https://example.com/docs/
Full offline mirror with extensions
wget -m -k -p -E https://example.com/
Mirror and save as WARC archive
wget --mirror --warc-file=site https://example.com/
Quick Commands
Download a single file from a URL
wget https://example.com/file.tar.gz
Resume an interrupted download
wget -c https://example.com/large.iso
Mirror an entire website for offline viewing
wget --mirror -k -p https://example.com/