原文:http://daniel.haxx.se/docs/curl-vs-wget.html
What both do
- both are command line tools that can download contents from FTP, HTTP and HTTPS
- both can send HTTP POST requests
- both support HTTP cookies
- both are designed to work without user interaction, like from within scripts
- both are fully open source and free software
- both projects were started in the 90s
How they differ
| curl | Wget |
- Features and is powered by libcurl - 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 is more in the traditional unix-style, it sends more stuff to stdout, and reads more from stdin in a "everything is a pipe" manner.

- 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, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP. Wget only supports HTTP, HTTPS and FTP.
- More portable. curl builds and runs on lots of more platforms than wget. 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 ten (10!) different SSL/TLS libraries, and it offers more control and wider support for protocol details
- curl supports more HTTP authentication methods, and especially when you try over HTTP proxies: Basic, Digest, NTLM and Negotiate
- curl supports lots of various SOCKS protocol versions for proxy access
- Bidirectional. 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 supports gzip and inflate Content-Encoding and does automatic decompression
- curl offers and performs decompression of Transfer-Encoded HTTP, wget doesn't
- curl supports metalink, wget has support for it coming (not yet released)
- Much 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 ohloh.net
|
- Wget is command line only. There's no lib or anything.
- 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, while curl 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, while curl requires -o or -O.
- Wget supports only GnuTLS or OpenSSL for SSL/TLS support
- Wget supports only Basic auth as the only auth type over HTTP proxy
- Wget has no SOCKS support
- Wget can be typed in using only the left hand
|