How-to

wget vs curl: Which Tool for Which Job

Both fetch things over HTTP. wget is built to download and keep downloading; curl is built to make any request exactly as specified. Most admins use both.

What sets the two tools apart?

wget is a downloader. Its defaults save files to disk, retry on failure, follow redirects and can crawl whole sites recursively. curl is a transfer tool. Its defaults print to standard output, follow nothing unless told and give precise control over methods, headers, bodies and protocols. Behind curl sits libcurl, a library embedded in countless programs; wget is mainly a command-line tool.

How do they compare feature by feature?

Taskwgetcurl
Save a fileDefault-O or -o name
Follow redirectsDefault-L
Resume a download-c-C -
Retry on failureDefault, 20 tries--retry N
Recursive download, mirroring-r, -mNot supported
POST, PUT, JSON APIsBasicFull control
ProtocolsHTTP, HTTPS, FTPDozens, including SFTP, SCP, SMTP, MQTT
Library for programsNolibcurl

When is wget the better choice?

  • Downloading large files over unreliable links, thanks to automatic retries and easy resume.
  • Fetching many files from a list with -i urls.txt.
  • Mirroring a site or a directory listing for an offline copy or a migration.
  • Background downloads that continue after you log out, with -b.
wget -c --tries=50 https://mirror.example.org/images/debian-13-genericcloud-amd64.qcow2

The details of each option are in The wget command.

When is curl the better choice?

  • Calling APIs with JSON bodies, tokens and custom headers.
  • Debugging web servers: status codes, timings, TLS details, redirects.
  • Testing a site on a new machine before DNS changes, with --resolve.
  • Scripted health checks that need exact exit codes and output.
curl -sS -o /dev/null -w 'dns %{time_namelookup}s  tls %{time_appconnect}s  first byte %{time_starttransfer}s\n' https://shop.example.net/

That one line breaks a request into name lookup, TLS setup and time to first byte, which wget cannot do. The broader tour is in The curl command.

Which one is installed by default?

curl is on practically every Linux image, because package managers and installers rely on it. wget is common but not universal on minimal installs; add it with apt install wget or dnf install wget. Some newer distributions have begun replacing wget with wget2, a rewrite with HTTP/2 support and parallel downloads, which keeps most familiar options. FreeBSD includes fetch in the base system, a small downloader of its own, and offers both tools as packages.

How do they handle output by default?

This trips people up most. wget URL writes a file named after the URL and prints a progress bar. curl URL prints the body to the terminal, which for a binary file means a screen full of garbage. Remember curl -O to save under the remote name, or curl -o name to choose one. In pipelines the defaults flip in curl's favor: curl -fsSL URL | tar -xz streams naturally, while wget needs -qO-.

Do they differ in security defaults?

Both verify TLS certificates by default and both have an option to skip it, --no-check-certificate in wget and -k in curl; neither belongs in production scripts, as curl and certificate errors explains. curl drops credentials when a redirect changes host; wget sends them only to the original host too, unless told otherwise. Keep both updated, since they parse untrusted data from the network.

What do I use on a new machine?

curl for everything interactive and API-related, wget for bulk and recursive downloads. Moving large data between your own machines, for example from Ashburn to Amsterdam, is usually better done with rsync over SSH, which resumes, compares and encrypts in one tool; see Rsync over SSH.

Can either tool upload files?

curl can, in many ways: -T for PUT uploads and SFTP or FTP targets, -F for form uploads. wget offers only basic POST options and no file upload, which settles the choice for any job that sends data.

Keep Reading

The curl command

A practical tour of curl for server admins: fetching, saving, timing, debugging, retrying, resolving and the flags that make scripts reliable.

Open

The wget command

Download with wget the robust way: resume, retries, file lists, rate limits, background jobs, mirroring and quiet output for scripts.

Open

Rsync over SSH

Copy and mirror folders between machines with rsync over SSH: trailing slashes, dry runs, custom ports, sudo on the far side and bandwidth caps.

Open

curl and certificate errors

When -k is acceptable, why it is risky, and better fixes: trusting a private CA, pinning a key, testing by IP with --resolve and repairing chains.

Open

FAQ

Quick Answers

wget, for large or many files: it saves to disk, retries and resumes by default.

curl, which controls methods, headers and bodies precisely.

No. Use wget -r or -m for recursive downloads and mirroring.

curl writes to standard output by default. Add -O or -o filename to save it.

Practically always. wget may need installing on minimal images.