136

Are they the same or not? Can certain things be done with one but not the other? What are those? Or is it, at the end of the day, a matter of familiarity?

tshepang
  • 12,111
  • 21
  • 91
  • 136
flybywire
  • 261,858
  • 191
  • 397
  • 503
  • 4
    MarcusQ had an answer suggesting to look at a comparison done by the curl guy: https://daniel.haxx.se/docs/curl-vs-wget.html . Unfortunately said answer was deleted instead of being turned into a comment. – Thorbjørn Ravn Andersen May 23 '17 at 10:27
  • If you are looking to send lots of requests by spawning many processes, Wget faster than Curl 2+ times (7s vs 15s on 500 requests nodejs) – Eugene Jan 08 '21 at 18:52

4 Answers4

48

If you are programming, you should use curl. It has a nice api and is available for most languages. Shelling out to the os to run wget is a kludge and shouldn't be done if you have an API interface!

Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168
  • 4
    I have never faced any problem shelling out WGET to Perl scripts to automate downloading stuff. However, with CURL, I frequently encounter **error 18 - transfer closed with outstanding read data remaining** (see http://stackoverflow.com/questions/1759956/curl-error-18-transfer-closed-with-outstanding-read-data-remaining). This error I mostly get while trying to use it in Perl scripts, but WGET never gives me such issues. Shouldn't this be taken into consideration? – SexyBeast Jun 17 '13 at 09:45
  • 5
    If you are using perl you really should be using the LWP library (LWP::Simple). It is always easier to read response codes, assign functional callbacks, and catch exceptions than to parse the text output of another process. – Byron Whitlock Jun 17 '13 at 18:44
33

There is some overlap in functionality. While GNU wget is a package for retrieving files using HTTP/FTP, curl transfers data with single URL. As noted in the link shared by MarkusQ, wget can download recursively - see this comparison article for more details by the curl author.

Community
  • 1
  • 1
David Kim
  • 866
  • 9
  • 11
22

cURL is intended for data transfer in both directions while wget is for non-interactive downloading file(s) from a particular source. There are some overlaps in functionality, but they are not meant to do exactly the same things.

It really depends on what you are trying to do; for simpler tasks like downloading files wget and cURL are comparable, but this really only scratches the surface of either tool.

icedwater
  • 4,701
  • 3
  • 35
  • 50
15

They both offer endless options, most of which I've never used. However, I tend to like wget more as it by default saves the output from the URL you give — perfect for downloading. Curl goes the other way, and displays the output directly to the terminal (by default).

Guðmundur H
  • 11,478
  • 3
  • 24
  • 22