wget Cheat Sheet

Fetch files and mirror sites over HTTP, HTTPS, and FTP with retries and recursion.

Core DevOps4 sections · 24 commands
⌘K

Basic Downloads

6
wget URL

Download into the working directory

wget -O FILE URL

Save under an explicit filename

wget -P DIR URL

Save into a directory

wget --limit-rate=500k URL

Throttle the download speed

wget -q URL

Quiet mode (no progress)

wget -i URLS.txt

Download every URL in a file

Resume & Retry

6
wget -c URL

Resume an interrupted download

wget --tries=5 URL

Retry up to 5 times

wget -nc URL

Never clobber an existing file

wget -t 0 URL

Retry indefinitely

wget --timeout=10 URL

Abort if no response in 10s

wget --continue --tries=0 URL

Resume forever until complete

Recursive & Mirroring

7
wget -r URL

Recursively download

wget -m URL

Mirror the site (full recursion)

wget -r -l 2 URL

Limit recursion depth to 2

wget -k URL

Convert links for offline viewing

wget -np URL

Do not ascend to parent directories

wget -A pdf,jpg URL

Accept only certain extensions

wget -X /path URL

Exclude a directory from recursion

Auth & Headers

5
wget --user=USER --ask-password URL

HTTP basic auth

wget --header='Authorization: Bearer TOKEN' URL

Custom header (e.g. API token)

wget --no-check-certificate URL

Skip TLS verification (testing only)

wget --header='Referer: URL' URL

Spoof the Referer header

wget --user-agent='Mozilla/5.0' URL

Override the user agent