Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · sockets & transfer

wget

download a file

wget fetches a URL and saves it as a file, under the name in the address. It is built for downloading: it retries, resumes a broken transfer, and can mirror a whole site.

curl prints a response to the screen; wget saves it to a file.

Saves to
A file
named from the URL
Resume
-c
continue a partial download
Rename
-O NAME
capital O
Follows
Redirects
by default

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashwget
$ wget https://example.com/files/tool-1.4.tar.gz
1Resolving example.com (example.com)... 192.0.2.80
Connecting to example.com (example.com)|192.0.2.80|:443... connected.
2HTTP request sent, awaiting response... 200 OK
Length: 4821033 (4.6M) [application/gzip]
Saving to: 'tool-1.4.tar.gz'
3tool-1.4.tar.gz 100%[===================>] 4.60M 3.12MB/s in 1.5s
4$ sha256sum tool-1.4.tar.gz
9f2c1e…a41b tool-1.4.tar.gz
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
DNS, then TCP

The name is resolved and a connection opened to port 443 — the same steps any HTTPS client takes.

2
The server’s answer

200 OK, followed by the size and type of what is about to arrive.

3
The progress bar

Percentage, bytes received, speed and time. The file is saved in the current directory.

4
Check what you got

Compare the checksum with the one the publisher lists. If they differ, the file is corrupt or not what it claims to be.

Switches

A switch changes how the command behaves. These are the ones used day to day; man wget lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-O FILE
Save under this name. "-O -" writes to standard output.
-c
Continue a partially downloaded file.
-q
Quiet: no progress output.
-P DIR
Save into this directory.
-i FILE
Read URLs from a file.
-r
Recursive: follow links and download what they point to.
--limit-rate=RATE
Limit the download speed, such as 500k.
-b
Go to the background straight after starting.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

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

Resumes a download that was cut off.

wget -O latest.tar.gz https://example.com/download

Saves under a name of your choosing.

wget -q -O - https://example.com/install.sh | less

Sends the download to a pager instead of a file, to read it first.

wget -i urls.txt

Downloads every URL listed in a file.

In cybersecurity

A downloaded file is someone else’s code arriving on your machine.

Verify before you run

Check the SHA-256 checksum or GPG signature against the publisher’s. HTTPS proves which server you reached, not that the file is the right one.

Never pipe straight to a shell

"wget -O - url | sh" runs whatever the server sends, unseen. Download it, read it, then run it.

Leave certificate checking on

--no-check-certificate makes the download open to interception. Fix the certificate problem instead.

Protocols it shows

HTTPTLSTCPDNSFTP

Read alongside