I am keen to know the difference between
wget. Both are used to get files and documents but what the key difference between them.
Why are there two different programs?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The main differences are:
wget's major strong side compared to
curlis its ability to download recursively.
wgetis command line only. There's no lib or anything, but
curl's features are powered by libcurl.
curlbuilds and runs on more platforms than
wgetis released under a free software copyleft license (the GNU GPL).
curlis released under a free software permissive license (a MIT derivate).
curloffers upload and sending capabilities.
wgetonly offers plain HTTP POST support.
You can see more details at the following link:
They were made for different purposes
wgetis a tool to download files from servers
curlis a tool that let's you exchange requests/responses with a server
Wget solely lets you download files from an
FTP server. You give it a link and it automatically downloads the file where the link points to. It builds the request automatically.
Curl in contrast to wget lets you build the request as you wish. Combine that with the plethora of protocols supported -
URI - and you get an amazing debugging tool (for testing protocols, testing server configurations, etc.).
As many already mentioned you can download a file with curl. True, but that is just an "extra". In practice, use CURL when you want to download a file via a protocol that wget doesn't support.
I did some performance tests with wget and curl, and the result is:
100 times tested average run time while download 1MB file:
wget: 0.844s cURL: 0.680s
100 times tested average run time while download 5MB file:
wget: 1.075s cURL: 0.863s
100 times tested average run time while download 10MB file:
wget: 1.182s cURL: 1.074s
Command size on the system:
wget: 371K cURL: 182K