Download files from the web via the OS X command line

May 11, 2007 - 8 Comments

Terminal Icon I am frequently developing web pages and often times I find it frustrating when I can not restart my browser because I’m in the middle of a download. So when I need to download a large file and I don’t want to have to worry about whether or not Safari or Firefox continues to run with out interruption, I turn to the trusty Terminal! Next time you have a file you want to download, option-click it and copy the URL into your clipboard. Now open a Terminal window and type:
cd ~/Desktop
Now that we have changed our directory to the “Desktop” we can start our download. For the download we are going to use a built in utility called “curl”.
curl -O http://www.bluechipx.com/downloads/BlueChip.sit
Read on for a screenshot of curl in action.

Curl in action

Related articles:

Posted by: Bill Ellis in Command Line, Mac OS X, Tips & Tricks

8 Comments

» Comments RSS Feed

  1. Dan Shockley says:

    You might want to include a few extra bits in that post. First, always include the -L (or –location) switch, since that will allow curl to follow any redirects (if the file gets moved, but there is a redirect for it). Also, if the URL’s file part (the section after the last slash) is not pretty, you can give a name for the downloaded file by using a lower-case -o (instead of -O), followed by a space and the name in quotes. Also, always put the URL in single-quotes – ampersands and a few other characters will break on the command line if they aren’t in quotes. Here’s an example of those ideas combined:

    curl -L -o ‘myfile.dmg’ ‘http://www.somewebsite.com/files/getdmg?id=24

  2. boomer says:

    I have never used the curl command but this is pretty good

  3. ToBeFrank says:

    I use wget

  4. Chris says:

    nice, this really helped me tonight

  5. Bill says:

    I also use wget. you have to download it and compile it. or install it using fink or macports.

  6. ton350d says:

    Thanks, for your share.I’m happy to use Terminal download ISO file :)

  7. Download says:

    Is there an addon or a command I can use to download all files from a directory or a page ?

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook