The wget command in Linux

wget downloads files over HTTP, HTTPS and FTP. Where curl is a general HTTP client, wget is a dedicated downloader: it retries on failure, resumes interrupted transfers, and can mirror entire websites — which makes it the tool of choice for fetching large files on unreliable connections.

How wget works

wget wraps the same networking fundamentals in a download manager's loop: request the file, and on failure retry with backoff; on resume (-c), send an HTTP Range header asking the server for "bytes N onward" and append to the partial file. That Range mechanism is the entire magic of resumable downloads — and why resume fails against the rare server that does not support it.

Recursive mode turns wget into a small crawler: fetch a page, parse the HTML for links, enqueue those on the same site, repeat to the configured depth — rewriting links afterwards (-k) so the local copy browses correctly offline. The politeness options (--wait, --limit-rate, honoring robots.txt) exist because a naive recursive fetch is indistinguishable from a small denial-of-service; a considerate mirror uses them.

Syntax

wget [OPTIONS] URL

Common options

OptionWhat it does
-O FILESave under a different name.
-cContinue a partially downloaded file.
-bGo to background immediately (log to wget-log).
-qQuiet mode.
--limit-rate=1mCap download speed.
-rRecursive download.
-npWith -r: don't ascend to parent directories.
--mirrorShortcut for mirroring a site (recursion + timestamps).

How to use wget: examples

$ wget https://example.com/ubuntu.iso

Download a file to the current directory.

$ wget -c https://example.com/ubuntu.iso

Resume the same download after an interruption — no need to start over.

$ wget -O latest.zip https://example.com/releases/v2.zip

Save under a chosen name.

$ wget -b https://example.com/huge-dataset.tar.gz

Download in the background; progress goes to wget-log.

$ wget --mirror -np -k https://docs.example.com/

Mirror a documentation site for offline reading (-k rewrites links to work locally).

Real-world use cases for wget

Fetching large files on bad connections

Downloading a 4 GB ISO over hotel Wi-Fi: wget -c URL survives every drop — each rerun resumes from the last byte received. For unattended fetches, wget -c -t 0 --waitretry=30 retries forever, patiently.

Archiving documentation for offline use

Flying tomorrow, need the docs: wget --mirror --convert-links --wait=1 -np https://docs.example.com/ produces a browsable local copy, with links rewritten to work from disk and a polite delay between requests.

Pro tips and common mistakes

Frequently asked questions about wget

How do I resume an interrupted download?

Run the same wget command with -c (continue). wget checks the partial file's size and requests only the remaining bytes.

Can wget download an entire website?

Yes: wget --mirror -np -k URL. Be considerate — add --wait=1 to pause between requests, and check the site's terms first.

wget or curl for scripts?

For plain "fetch this file reliably", wget's retry/resume defaults win. For anything involving APIs, headers or methods other than GET, use curl.

Related commands

tar

Create and extract archives: tar.gz, tar.bz2 — with the flag combinations finally explained.

ssh

Log into remote machines, run remote commands, use keys instead of passwords, and tunnel ports.

curl

Download files, test APIs, send POST requests with JSON, and inspect headers.

Want to build real fluency? The interactive course takes you through wget and every other essential command with guided, checked exercises.