Download files from the web via the OS X command line

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 Posts with Thumbnails

6 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′

    • Greg says:

      Thanks for adding that, Dan. That was the crucial tip I needed, especially the reminder about the quotes.

  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.

Leave a Reply

 

Save big on Apple & Mac Deals from Amazon.com

Recent Comments

Shared on Facebook

Support Us

Mac Picks

iPhone & iPad Picks

Mac from PC Picks