<Marc Qualie/>

Using Curl to Download Files via Command Line

I recently just discovered that Mac OSX doesn't have <a href="https://github.com/mirror/wget" target="_blank"">wget functionality, and that's one of the most useful things about the command line to quickly download files without a UI. The most common time I use it is when I want to download .swf files, which isn't very streamlined through the browser. The quickest way to download a file would be to run:

wget -O ~/Downloads/eggstinction.swf https://www.freeonlinegames.com/games/21945/game.swf

in the command and your file would simply be in your Downloads folder. Since wget isn't available, this is where curl comes in. To do this in Mac OSX (or any other OS with Curl installed) you would simply run:

curl https://www.freeonlinegames.com/games/21945/game.swf > ~/Downloads/eggstinction.swf

Very short post, but straight to the point. Downloading files in this mannor is very useful, one of which is storing large files in a personal cloud system then only downloading them when you need them. Very useful if you write a script to download batches using curl, but that's another post.

If you have any questions about this post, or anything else, you can get in touch on Twitter or browse my code on Github.