Search

Top Posts

Comments

  • slatapolsky: I should have updated this earlier, but I went ahead and upgraded from our old Netgear router (G) to a...
  • Cory: @Dave: It looks like 3rd party developers have access to this functionality, but not all use it. For example, I...
  • ZAYIFLAMA YOLLARI: Zayıflama Yolları, diyet listesi,rejim
  • Dan: You’d definitely need a microphone, mic stand and usb audio interface for a start!
  • Sepp: Mac OS X comes with an even more powerful Firewall than the one in the system preferences. Open up the Terminal...

Categories

Recent Posts


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

Posted by: Bill Ellis

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 4

Comment from Dan Shockley
Time: May 12, 2007, 2:56 pm

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′

Comment from boomer
Time: May 14, 2007, 7:53 am

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

Comment from ToBeFrank
Time: May 28, 2007, 12:31 am

I use wget

Comment from Chris
Time: June 24, 2009, 11:15 pm

nice, this really helped me tonight

Write a comment






May 11th, 2007