What is the difference between curl and wget? [closed]
After you've defined "proper use", use wget
.
Why? That's why:
Recursive! wget's major strong side compared to curl is its ability to download recursively, or even just download everything that is referred to from a remote resource, be it a HTML page or a FTP directory listing.
Shameless copied from here
curl
library.
curl
is powered bylibcurl
– a cross-platform library with a stable API that can be used by each and everyone. This difference is major since it creates a completely different attitude on how to do things internally. It is also slightly harder to make a library than a "mere" command line tool.pipes.
curl
works more like the traditional Unixcat
command, it sends more stuff tostdout
, and reads more fromstdin
in a "everything is a pipe" manner.wget
is more likecp
, using the same analogue.Single shot.
curl
is basically made to do single-shot transfers of data. It transfers just the URLs that the user specifies, and does not contain any recursive downloading logic nor any sort of HTML parser.More protocols.
curl
supports FTP, FTPS, Gopher, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMB/CIFS, SMTP, RTMP and RTSP. Wget only supports HTTP, HTTPS and FTP.More portable.
curl
builds and runs on lots of more platforms thanwget
. For example: OS/400, TPF and other more "exotic" platforms that aren't straight-forward Unix clones.More SSL libraries and SSL support.
curl
can be built with one out of eleven (11!) different SSL/TLS libraries, and it offers more control and wider support for protocol details.curl
supports public key pinning.HTTP auth.
curl
supports more HTTP authentication methods, especially over HTTP proxies: Basic, Digest, NTLM and NegotiateSOCKS.
curl
supports several SOCKS protocol versions for proxy accessBidirectional.
curl
offers upload and sending capabilities.wget
only offers plain HTTP POST support.HTTP multipart/form-data sending, which allows users to do HTTP "upload" and in general emulate browsers and do HTTP automation to a wider extent
curl
supportsgzip
and inflate Content-Encoding and does automatic decompressioncurl
offers and performs decompression of Transfer-Encoded HTTP, wget doesn'tcurl
supports HTTP/2 and it does dual-stack connects using Happy EyeballsMuch more developer activity. While this can be debated, I consider three metrics here: mailing list activity, source code commit frequency and release frequency. Anyone following these two projects can see that the curl project has a lot higher pace in all these areas, and it has been so for 10+ years. Compare on openhub
wget
wget
is command line only. There's no library.Recursive!
wget
's major strong side compared to curl is its ability to download recursively, or even just download everything that is referred to from a remote resource, be it a HTML page or a FTP directory listing.Older.
wget
has traces back to 1995, whilecurl
can be tracked back no earlier than the end of 1996.GPL.
wget
is 100% GPL v3. curl is MIT licensed.GNU.
wget
is part of the GNU project and all copyrights are assigned to FSF. The curl project is entirely stand-alone and independent with no organization parenting at all with almost all copyrights owned by Daniel.wget
requires no extra options to simply download a remote URL to a local file, whilecurl
requires-o
or-O
.wget
supports the Public Suffix List for handling cookie domains, curl does not.wget
supports only GnuTLS or OpenSSL for SSL/TLS supportwget
supports only Basic auth as the only auth type over HTTP proxywget
has no SOCKS supportIts ability to recover from a prematurely broken transfer and continue downloading has no counterpart in curl.
wget
can be typed in using only the left hand on a qwerty keyboard!
There are many tools that can download like curl
,snarf
, wget
, pavuk
, fget
, fetch
, lftp
,aria2
, HTTrack
etc. Use it according to your requirement and which feature you want to use along with downloading.
Check feature table and use accordingly .
Curl :
- Curl support more protocol FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP
- Curl support more SSL libraries
- Curl supports more HTTP authentication methods, especially over HTTP proxies: Basic, Digest, NTLM and Negotiate
- Curl is powered by libcurl -a cross-platform library with a stable API that can be used by each and everyone
Wget :
- While wget supports HTTP, HTTPS and FTP
- Wget supports only GnuTLS or OpenSSL for SSL/TLS support
- Wget supports only Basic auth as the only auth type over HTTP proxy
- Wget is command line tool only, it has no library.
Important Resources for more info :
Here is good explanation curl vs Wget.
Table of features : Compare cURL Features with Other Download Tools
Detail of curl supported features : Features -- what can curl do
Detail of wget supported features : wget features
They have much functionality in common, but curl
has more options. For wget
it may occasionally be sufficient to leaf through man wget
, but for curl
I need to study this webpage in a browser. I believe anything your browser can do, curl
can do as well.