curl vs wget — the difference, and why curl saved an empty file

You want to download an archive from a GitHub release. You type:
curl -O https://github.com/user/app/releases/latest/download/app.zip
app.zip appears. You unpack it — not a zip file. You check the size — 0 bytes. We tested this on a real release.
Meanwhile someone in the chat suggests wget with the same link — and it downloads fine for them. They look like two identical downloaders of different ages. They aren't. They have different personalities — and that explains both the empty file and why AI always writes curl -fsSL.
In short: who's who
- curl is a Swiss army knife for HTTP requests. It sends a request and prints the response to the terminal. Downloading is just one of its skills.
- wget is a downloader. Its job is to save a file to disk and not give up even if the connection drops.
Picture a faucet and a packing machine. curl is the faucet: open it and the stream goes wherever you point it. wget is the machine: takes the goods, packs them, puts them on a shelf.
The difference, point by point
Where the result goes
- curl: to the terminal. Download an image without flags and you get a screen of garbage. You need
-o nameor-O. - wget: straight to a file in the current folder.
Redirects
- curl: by default it doesn't follow them. GitHub answers "the file is over there" (code 302), and curl saves that answer — which is 0 bytes. That's your "broken" archive. The fix is the
-Lflag. - wget: follows redirects on its own.
Server errors
- curl: on a 404 it quietly saves the error page and exits successfully. Your script keeps going with HTML instead of an archive. The
-fflag makes it fail. What those numbers mean is in the article on HTTP status codes. - wget: on a server error it returns a non-zero exit code.
Dropped connection and resume
- curl: can do it, but you have to remember
-C -. - wget:
-cpicks up where it stopped. And it retries on network hiccups by itself.
Downloading a whole site
- curl: can't follow links.
- wget: can —
wget -ror--mirror.
Talking to APIs
- curl: its home turf. Methods, headers, request body, file uploads — all with flags. Almost every API's docs show examples in curl. What an API is, see what is a REST API.
- wget: can send a POST, but awkwardly.
Where it's already installed
- curl: macOS, Windows 10 and 11, almost every Linux.
- wget: most Linux. Not on a Mac — install it with
brew install wget.
Decoding curl -fsSL
You see this combo in every install guide. Now it reads plainly:
-f— fail on a server error instead of saving the 404 page;-s— don't draw the progress bar;-S— but still show errors;-L— follow redirects.
Without -f and -L, an install script could silently download an error page and run it. So it's not a magic spell — it's four patches over curl's personality.
Which one fits whom
- Testing an API, writing a request for a backend, copying an example from docs — curl. Don't even think about it.
- Installing a program with a
curl ... | shinstruction — curl, since that's what it says. But open the script URL in a browser first and see what it does. - Downloading a big file to a server over a flaky network — wget with
-c. If it drops, you continue instead of starting over. - Need to grab a site or a folder of files — wget
--mirror. - A script must work on both Mac and Linux — curl: it's everywhere with no install.
My advice for a beginner: learn curl. You'll need it nine times out of ten. Keep wget for heavy downloads on a server.
Why does curl act weird on Windows?
In the old Windows PowerShell 5.1, the word curl is an alias for Invoke-WebRequest, and the flags don't work. Type curl.exe — and the real curl runs.
How do I download a file with curl properly?
curl -fLO URL — saves the file under its own name, follows redirects, and fails on errors. That's a one-line replacement for wget URL.
How do I see where a link leads?
curl -sIL URL shows only the response headers — and the whole redirect chain. You instantly see where the 302 is and where the real file and its size are.
Can wget do everything curl does?
No. wget is about downloading over HTTP, HTTPS and FTP. curl speaks dozens of protocols and fine-tunes any request.
Short story-lessons, an agent simulator and daily practice — in our mobile app. Free.





