Basic Usage
wget https://example.com/file.zip
Download a file to the current directory
wget -O output.zip https://example.com/file.zip
Download a file and save it with a different name
wget -c https://example.com/file.zip
Resume a paused or interrupted download
wget -P /path/to/directory https://example.com/file.zip
Download a file to a specific directory
Multiple Files
wget -i urls.txt
Download files from URLs listed in a text file
wget https://example.com/file{1..10}.jpg
Download a sequence of files (file1.jpg to file10.jpg)
Website Mirroring
wget -m https://example.com/
Mirror a website (downloads the entire site)
wget -m -k -p https://example.com/
Mirror a website and convert links for offline viewing
wget -r -l 2 https://example.com/
Recursively download pages up to 2 levels deep
wget -r -np https://example.com/dir/
Recursively download but don't ascend to parent directory
Download Customization
wget -U "Mozilla/5.0" https://example.com/file.zip
Set a custom user agent
wget --limit-rate=200k https://example.com/file.zip
Limit download speed (e.g., to 200KB/s)
wget --wait=2 https://example.com/file.zip
Wait specified seconds between retrievals
wget --random-wait https://example.com/file.zip
Wait random amount of time between retrievals
Authentication
wget --user=username --password=password https://example.com/file.zip
HTTP authentication
wget --ftp-user=username --ftp-password=password ftp://example.com/file.zip
FTP authentication
Output Options
wget -q https://example.com/file.zip
Quiet mode (no output)
wget -v https://example.com/file.zip
Verbose output
wget -o log.txt https://example.com/file.zip
Log messages to a file
wget -a log.txt https://example.com/file.zip
Append log messages to a file
Advanced Options
wget --reject=png,jpg https://example.com/
Reject certain file types
wget --accept=pdf,doc https://example.com/
Accept only certain file types
wget --spider https://example.com/file.zip
Check if a file exists without downloading
wget --tries=10 https://example.com/file.zip
Set number of retry attempts
wget --background https://example.com/largefile.zip
Download in the background
wget --no-check-certificate https://example.com/file.zip
Skip SSL certificate validation (use with caution)