Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am keen to know the difference between curl and wget. Both are used to get files and documents but what the key difference between them.

Why are there two different programs?

share|improve this question
    
Main difference is that wget is used to download things while curl is used to test communication by using a specific protocol. –  Pithikos Aug 15 at 13:29

3 Answers 3

up vote 46 down vote accepted

The main differences are:

  • wget's major strong side compared to curl is its ability to download recursively.
  • wget is command line only. There's no lib or anything, but curl features and is powered by libcurl.
  • curl supports FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP. wget supports HTTP, HTTPS and FTP.
  • curl builds and runs on more platforms than wget.
  • 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
  • curl offers upload and sending capabilities. wget only offers plain HTTP POST support.

You can see more details at the following link:

curl vs Wget

share|improve this answer

Actually, the major difference is that curl includes a library (libcurl), and that library is widely used by other applications. wget is standalone.

share|improve this answer

What the guys mentioned is true but from the user's point of view there is only one difference:

  • wget is used to download things
  • curl is used to see/test what response you get from a machine

For example

wget http://www.google.com

will download the HTML file located at www.google.com, while

curl http://www.google.com

will just print onscreen the server's response. In this case:

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.uk/?gfe_rd=cr&amp;ei=JQTuU5GuKMWE8Qf-woGIBQ">here</A>.
</BODY></HTML>

What happened is that curl saw that you wrote http://.. so it understood that it had to send a GET message to the server. Then it got the response andread the payload of the HTTP message which is what you see. If instead you wrote something like:

curl ftp://www.google.com

curl would send an FTP message instead but since Google doesn't run an FTP server at www.google.com, it wouldn't get any response. So with curl we accomplished to test if the server at Google is running an FTP service and if the HTTP server is running!

share|improve this answer
    
Actually wget also follows the redirect then saves the response unlike curl. Both can achieve the opposite to the default behaviour wget -qO - http://google.co.uk/ or curl http://google.co.uk/ > index.html –  mtm Aug 15 at 17:46
    
@mtm curl http://google.co.uk/ > index.html is not using an inbuilt functionality though. Anyway the main distinction is the purpose each tool was made for. There is not denying that tools evolve and many times deviate from their initial trajectory. –  Pithikos Aug 16 at 10:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.