Skip to content

Instantly share code, notes, and snippets.

@joe-oli
Created January 18, 2026 14:41
Show Gist options
  • Select an option

  • Save joe-oli/9e763925d4d9ab2f163cf88e4f9fdc3e to your computer and use it in GitHub Desktop.

Select an option

Save joe-oli/9e763925d4d9ab2f163cf88e4f9fdc3e to your computer and use it in GitHub Desktop.
curl vs wget

wget and curl both fetch data over the network, but they have different design goals. The simplest way to remember it:

wget = download files curl = talk to services

Below is the clean mental model, then details.


1️⃣ Core philosophy (the “why”)

wget

  • Built to download files
  • Fire-and-forget
  • Great for scripts that need files no matter what

curl

  • Built to transfer data
  • Designed for APIs, testing, automation
  • Think: HTTP client toolkit

2️⃣ Basic usage comparison

Download a file

wget https://example.com/file.iso
curl -O https://example.com/file.iso

Both work. But wget is simpler and more resilient by default.


3️⃣ Key differences (practical table)

Feature wget curl
Default use File downloading Data transfer
Recursive download ✅ Yes ❌ No
Resume downloads ✅ Yes ⚠️ Manual
Mirrors support ✅ Yes ❌ No
API requests ⚠️ Limited ✅ Excellent
HTTP methods (POST, PUT, DELETE) ❌ Weak ✅ First-class
JSON headers ❌ Awkward ✅ Easy
Output to stdout ❌ No (by default) ✅ Yes
Libraries ❌ CLI-only ✅ libcurl
Installed by default Often Almost always

4️⃣ Why sysadmins love wget

Resumable downloads (killer feature)

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

If the connection drops → it resumes.


Recursive downloads

wget -r https://example.com/docs/

curl cannot do this.


Mirror a website

wget --mirror --convert-links https://example.com

5️⃣ Why engineers love curl

APIs (this is curl’s home turf)

curl https://api.github.com

POST JSON:

curl -X POST https://api.example.com/login \
  -H "Content-Type: application/json" \
  -d '{"user":"bob","pass":"secret"}'

This is painful or impossible with wget.


Inspect headers

curl -I https://example.com

Debug TLS / HTTP

curl -v https://example.com

Pipe data

curl https://example.com/script.sh | bash

wget writes to disk by default; piping is awkward.


6️⃣ Behavior differences that trip people up

Output destination

  • wget → file
  • curl → stdout
curl https://example.com > file.txt

or:

curl -o file.txt https://example.com

Error handling

  • curl fails loudly
  • wget retries automatically

This is why wget is better for flaky networks.


7️⃣ Which should you use?

Use wget when:

  • Downloading ISOs
  • Fetching large files
  • Mirroring content
  • You want retries + resume automatically
  • Writing simple install scripts

Proxmox ISO? → wget


Use curl when:

  • Talking to REST APIs
  • Testing HTTP endpoints
  • Sending JSON
  • Inspecting headers
  • Scripting complex requests

API / web service? → curl


8️⃣ One-line rule to memorize

wget gets files. curl talks to servers.

If you follow that rule, you’ll almost never pick the wrong tool.


9️⃣ Bonus: common myth

“curl can replace wget”

Technically yes. Practically no.

You can download files with curl — but you’ll keep re-implementing features wget already solved.


If you want, I can give you:

  • A wget vs curl cheat sheet
  • A “convert wget → curl” map
  • Real-world examples (Proxmox, cloud-init, APIs)

Just say the word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment