Apr 02

wget replacment curlSo when you need to download a large file and don’t want to have to worry about whether or not Safari or Firefox continues to run with out interruption, use Terminal and curl (wget replacement).

Note: wget is not exists in Leopard,  you should set up an alias for wget to curl -O which does exactly the same thing:

echo 'alias wget="curl -O"' >> ~/.bash_profile

Your are done. Now just easy to use in Terminal. Here example to download iTunes.
wget http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iTunes9/061-7203.20100330.XswP8/iTunes9.1.dmg

Curl is better than wget for the following reasons:

  • Uses libcurl a cross platform library
  • curl sends more stuff to stdout and reads more from stdin
  • curl supports ftp, ftps, http, https, scp sftp, tftp, telnet, dict, ldap and ldaps while wget
  • supports only http, https and ftp
  • curl has ssl support
  • libcurl supports more http authentication methods
  • Curl is bidirectional while wget offers http post support only
  • Curl has more development activities.

In fact, curl offers substantially better download statistics during
interactive use. It also has th excellent libCURL, which programs in the
operating system leverage as a transport layer. This is simply not
possible using wget, and writing an HTTP 1.1 client is pointless when a
really good one is already available.

Anything you can do with wget you can do with curl (with a little effort),
but no amount of effort will result in a well-factored libWGET. You can
(and I have) implemented recursive retrieval by passing the output of curl
through a sed script to find tags and download the target with more
curl invocations.

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...


16 Responses to “A wget replacement for MAC OS X”

  1. 1.roger Says:

    I’ll admit libcurl is better than any libwget, but curl on the command line is about as good (I think–and yes wget has ssl support). Regardless thanks for the tip worked a charm :)

  2. 2.Segovia Says:

    I’ve done exactly what you stated, however when I now type

    wget http://url.com

    I get the following error:

    -bash: wget: command not found

    Then if I type “nano ~/.bash_profile” I can see the file alias you suggested which only contains:

    alias wget=”curl -O”

    What am I doing wrong? Should I delete the file and try and use “sudo” to make it again?

    Also, if I try and simply use curl as the command it works fine.

    curl -O http://www.mymacosx.com/files/2010/04/wget1.png

    Thanks for your help.

  3. 3.Amaga Says:

    Please just restart your computer or LOGOUT and LOGIN. must be help.

  4. 4.Bill Says:

    … no need to restart or logout… just start a new terminal. .bash_profile is loaded on your current terminal session, but not the newly edited one with your echo statement.

  5. 5.Rob Says:

    Thanks for this tip on installing the wget alias on macs. Very usefule and easy to read.

  6. 6.Kris Spade Says:

    Type “source .bash_profile” to have your changes load in the current terminal or logout and log back in like the others suggest.

  7. 7.DS Says:

    “Anything you can do with wget you can do with curl (with a little effort).”

    Any idea how to download a webpage when the URL is specified without a filename, and index.

    [/html]

    doesn’t work? E.g., http://www.mymacosx.com/ .

    curl can’t do this any way I’ve tried, it just hangs. wget works like a charm. Hopefully I’m just missing something about curl…

    Thanks!

  8. 8.DS Says:

    Ah, I’ve found a solution: http://download.cnet.com/Wget/3000-18506_4-128268.html

    wget for Macs, trivial install :) Maybe curl can do it, but wget makes it so easy…

  9. 9.Simon Says:

    @Segovia – you’re doing ‘curl -O’ (letter oh) and if read the output of ‘curl –help’ you need to be using ‘curl -0′ (zero)

  10. 10.gmopinillosv Says:

    Hello there

    Somebody knows to execute binary files under command line.

    When I put: ./hldsupdatetool.bin , I received: can not execute binary files

    thanks.

  11. 11.anacron Says:

    awesome! thanks

  12. 12.Mr.F Says:

    gmopinillosv – you need to make it exicutble

    chmod +x hldsupdatetool.bin

  13. 13.Joe Says:

    wget may support fewer features, but it’s much easier to use. If you’re willing to write a sed script just to get recursive downloads, why aren’t you willing to download the source and build wget yourself?

  14. 14.dayath Says:

    “dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
    Referenced from: /opt/local/bin/wget
    Reason: Incompatible library version: wget requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
    Trace/BPT trap”

    what is that mean?

  15. 15.genekeats Says:

    this curl suggestion is great for individual downloads — a common invocation of wget — but for recursive gets, wget is king. if you’ve written a script to handle recursion for curl, share it! :-)

  16. 16.John Doe Says:

    I have added -L to it, so it does not fail if a HTTP header has a “moved” response.

    so curl -OL

    Regards

Leave a Reply

This is website related to mac 0R windows platform?