What is better, curl or wget?

LinuxCurlWget

Linux Problem Overview


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?

Linux Solutions


Solution 1 - Linux

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!

Solution 2 - Linux

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.

Solution 3 - Linux

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.

Solution 4 - Linux

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).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionflybywireView Question on Stackoverflow
Solution 1 - LinuxByron WhitlockView Answer on Stackoverflow
Solution 2 - LinuxDavid KimView Answer on Stackoverflow
Solution 3 - LinuxicedwaterView Answer on Stackoverflow
Solution 4 - LinuxGuðmundur HView Answer on Stackoverflow