wget(1)
Download files from the web using HTTP, HTTPS, or FTP protocols.
Synopsis
wget [OPTION]... [URL]...Description
wget is a non-interactive network downloader that retrieves files from web and FTP servers. It supports recursive downloads, can follow links, handles redirects automatically, and works in the background or via cron jobs.
It's particularly useful for downloading large files, mirroring websites, and scripted downloads where you need a command-line tool that doesn't require user interaction.
Common options
| Flag | What it does |
|---|---|
-O FILE | Save downloaded file as FILE instead of the original name |
-q | Quiet mode; suppress all output messages |
-b | Go to background immediately after startup |
-c | Resume partial download; continue interrupted transfers |
-r | Recursive download; follow links and download entire website |
-l DEPTH | Recursion depth limit; maximum levels to follow (default 5) |
-p | Page requisites; download images, stylesheets, etc. needed for pages |
-A LIST | Whitelist; only download files matching patterns (e.g., -A '*.pdf,*.zip') |
-R LIST | Blacklist; exclude files matching patterns from download |
--limit-rate=RATE | Limit download speed (e.g., --limit-rate=500k for 500KB/s) |
-U AGENT | Set User-Agent header to pretend to be a different browser |
--timeout=SECONDS | Set read timeout in seconds |
Examples
Download a single file to current directory
wget https://example.com/file.zipDownload and rename the file to 'myfile.zip'
wget -O myfile.zip https://example.com/file.zipResume a partially downloaded ISO file
wget -c https://example.com/largefile.isoDownload in background; output logged to download.log
wget -b -O download.log https://example.com/huge-file.tar.gzMirror website up to 2 levels deep with all supporting files (images, CSS)
wget -r -l 2 -p https://example.com/Recursively download only PDF files from a website
wget -A '*.pdf' -r https://docs.example.com/Download limiting speed to 1MB/s, silent mode
wget --limit-rate=1m -q https://example.com/video.mp4Download multiple files listed in urls.txt (one URL per line)
wget -i urls.txt