Bash Download Files

wget is a non-interactive downloader built for reliably saving files, and even entire websites, straight to disk.

What Is wget?

wget downloads content from HTTP, HTTPS, and FTP URLs and writes it to disk by default, unlike curl which prints to standard output unless told otherwise. It is designed to run unattended, which is why it has strong built-in support for retries, resuming interrupted transfers, and recursive downloads.

Downloading a Single File

Run wget with a URL and it saves the file to the current directory using the filename from the URL, printing a live progress bar as it goes.

Downloading a File

$ wget https://releases.example.com/tools/build-agent-2.4.0.tar.gz
--2026-07-16 09:14:02--  https://releases.example.com/tools/build-agent-2.4.0.tar.gz
Resolving releases.example.com (releases.example.com)... 203.0.113.55
Connecting to releases.example.com (releases.example.com)|203.0.113.55|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48213504 (46M) [application/gzip]
Saving to: 'build-agent-2.4.0.tar.gz'

build-agent-2.4.0.tar.gz   100%[=========================>]  45.98M  22.4MB/s   in 2.1s

2026-07-16 09:14:04 (21.7 MB/s) - 'build-agent-2.4.0.tar.gz' saved [48213504/48213504]

Choosing a Filename and Resuming Downloads

Use -O to save under a specific name instead of the one in the URL, and -c to continue a partially downloaded file rather than starting over -- essential on flaky connections or with large files.

Saving Under a Custom Name and Resuming

$ wget -O linux-notes.pdf https://example.com/downloads/notes.pdf?v=3
Saving to: 'linux-notes.pdf'
linux-notes.pdf   100%[=========================>]  842K  1.2MB/s   in 0.7s

$ wget -c https://example.com/downloads/bigfile.tar.gz
Saving to: 'bigfile.tar.gz'
bigfile.tar.gz   45%[========>            ]  102M  9.8MB/s   eta 12s

Downloading Quietly and in the Background

Add -q to suppress all output for use in scripts, or -b to detach the download into the background and keep working, with progress logged to wget-log instead of the terminal.

Quiet and Background Downloads

$ wget -q -O - https://example.com/status.json
{"status":"ok","uptime":"14d"}

$ wget -b https://example.com/downloads/archive.zip
Continuing in background, pid 20481.
Output will be written to 'wget-log'.
Taskcurlwget
Default behaviorPrints response to stdoutSaves response to a file
Best forAPIs, one-off requests, debuggingBulk downloads, unattended jobs
Resume a download--continue-at --c
Follow redirects-L (off by default)On by default
Recursive site mirroringNot supported-r / --mirror
Silent mode-s-q
Note: Choose curl when you need fine control over requests, such as custom methods, headers, or JSON bodies, and choose wget when the goal is simply getting a file, or a whole directory tree, onto disk reliably.