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
6wget URLDownload into the working directory
wget -O FILE URLSave under an explicit filename
wget -P DIR URLSave into a directory
wget --limit-rate=500k URLThrottle the download speed
wget -q URLQuiet mode (no progress)
wget -i URLS.txtDownload every URL in a file
Resume & Retry
6wget -c URLResume an interrupted download
wget --tries=5 URLRetry up to 5 times
wget -nc URLNever clobber an existing file
wget -t 0 URLRetry indefinitely
wget --timeout=10 URLAbort if no response in 10s
wget --continue --tries=0 URLResume forever until complete
Recursive & Mirroring
7wget -r URLRecursively download
wget -m URLMirror the site (full recursion)
wget -r -l 2 URLLimit recursion depth to 2
wget -k URLConvert links for offline viewing
wget -np URLDo not ascend to parent directories
wget -A pdf,jpg URLAccept only certain extensions
wget -X /path URLExclude a directory from recursion
Auth & Headers
5wget --user=USER --ask-password URLHTTP basic auth
wget --header='Authorization: Bearer TOKEN' URLCustom header (e.g. API token)
wget --no-check-certificate URLSkip TLS verification (testing only)
wget --header='Referer: URL' URLSpoof the Referer header
wget --user-agent='Mozilla/5.0' URLOverride the user agent