$linuxjunkies
>

wget(1)

Download files from the web using HTTP, HTTPS, or FTP protocols.

UbuntuDebianFedoraArch

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

FlagWhat it does
-O FILESave downloaded file as FILE instead of the original name
-qQuiet mode; suppress all output messages
-bGo to background immediately after startup
-cResume partial download; continue interrupted transfers
-rRecursive download; follow links and download entire website
-l DEPTHRecursion depth limit; maximum levels to follow (default 5)
-pPage requisites; download images, stylesheets, etc. needed for pages
-A LISTWhitelist; only download files matching patterns (e.g., -A '*.pdf,*.zip')
-R LISTBlacklist; exclude files matching patterns from download
--limit-rate=RATELimit download speed (e.g., --limit-rate=500k for 500KB/s)
-U AGENTSet User-Agent header to pretend to be a different browser
--timeout=SECONDSSet read timeout in seconds

Examples

Download a single file to current directory

wget https://example.com/file.zip

Download and rename the file to 'myfile.zip'

wget -O myfile.zip https://example.com/file.zip

Resume a partially downloaded ISO file

wget -c https://example.com/largefile.iso

Download in background; output logged to download.log

wget -b -O download.log https://example.com/huge-file.tar.gz

Mirror 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.mp4

Download multiple files listed in urls.txt (one URL per line)

wget -i urls.txt

Related commands