Home » Linux wget Cheat Sheet

Linux wget Cheat Sheet

by 7kokcmax71

wget is a command-line tool used to download files from the web, supporting HTTP, HTTPS, and FTP protocols.

Basic Usage

Command Description
wget URL Download a file from a URL.
wget -O filename URL Download and save as a specific filename.
wget -P /path/to/dir URL Download to a specific directory.
wget -q URL Quiet mode (no output).
wget -nv URL Minimal output (non-verbose).

Example: Download a file and rename it

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

Resume Interrupted Downloads

Command Description
wget -c URL Resume an interrupted download.

Example: Resume a large download

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

Download Multiple Files

Command Description
wget -i file.txt Download URLs listed in file.txt.

Example: Download multiple files from a list

  1. Create a file with URLs (urls.txt):
https://example.com/file1.zip
https://example.com/file2.zip
https://example.com/file3.zip
  1. Run:
wget -i urls.txt

Mirroring a Website

Command Description
wget -m URL Mirror a full website.
wget –mirror –convert-links -P /path/to/dir URL Download and fix links for offline browsing.

Example: Download an entire website

wget -m https://example.com

Download with Authentication

Command Description
wget –user=username –password=password URL Download from password-protected sites.
wget –http-user=username –http-password=password URL HTTP authentication.

Example: Access a protected file

wget --user=admin --password=secret https://example.com/private.pdf

Limiting Download Speed & Retries

Command Description
wget –limit-rate=200k URL Limit speed to 200KB/s.
wget –tries=5 URL Retry 5 times if the download fails.

Example: Download with limited bandwidth

wget --limit-rate=500k https://example.com/bigfile.iso

Downloading in Background

Command Description
wget -b URL Run in background.
wget -o log.txt URL Log output to a file.

Example: Background download with logging

wget -b -o download.log https://example.com/large.iso

Checking File Integrity

Command Description
wget URL && md5sum file Verify file integrity.

Example: Check MD5 checksum after download

wget https://example.com/file.iso
md5sum file.iso

Downloading Specific File Types

Command Description
wget -r -A “*.pdf” URL Download only PDFs from a site.

Example: Download all .jpg images from a site

wget -r -A "*.jpg" https://example.com/images/

Summary

Feature Command Example
Basic Download wget URL
Resume Download wget -c URL
Save with Custom Name wget -O file.zip URL
Download Multiple URLs wget -i urls.txt
Limit Download Speed wget –limit-rate=500k URL
Mirror Website wget -m https://example.com
Background Download wget -b URL
Authentication wget –user=admin –password=secret URL

This Linux wget Cheat Sheet helps you download files efficiently using various options!

You may also like

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.