Download A File Using Cygwin and cURL
I'm starting to like using Cygwin more and more. Command line scripting allows me to get the information without all of the hassle. Why should I open Firefox, type in the address, deal with the ads, and click 5 links before I can get to what I want when I can use command line to download what I want? Here's how you can download a file using the cURL package from the command line.
The Bash Script
curl https://davidwalsh.name/ --O homepage.txt
The above example downloads my homepage and saves it into a file named homepage.txt. The file gets downloaded to the c:\cygwin\home\{user}\ folder. For fun, here's how to download Cygwin's setup file from Cygwin.
curl http://cygwin.com/setup.exe --O cygwin-setup.exe
Great stuff. What would you use this for?
![Chris Coyier’s Favorite CodePen Demos]()
David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...
![CSS 3D Folding Animation]()
Google Plus provides loads of inspiration for front-end developers, especially when it comes to the CSS and JavaScript wonders they create. Last year I duplicated their incredible PhotoStack effect with both MooTools and pure CSS; this time I'm going to duplicate...
![RealTime Stock Quotes with MooTools Request.Stocks and YQL]()
It goes without saying but MooTools' inheritance pattern allows for creation of small, simple classes that possess immense power. One example of that power is a class that inherits from Request, Request.JSON, and Request.JSONP: Request.Stocks. Created by Enrique Erne, this great MooTools class acts as...
![MooTools Kwicks Plugin]()
I wrote a post titled Get Slick with MooTools Kwicks ages ago. The post was quite popular and the effect has been used often. Looking back now, the original code doesn't look as clean as it could. I've revised the original...
I’ve used curl to download a ton of scanned documents from the Library of Congress. Each page was done as a separate TIF and after doing about 10 manually from the browser I learned from a friend about curl… Now if I had only been smart enough to handled getting both TIF and JPG at the same time…
I typically use curl to download files onto my server rather than downloading to whatever machine I’m working on and then using FTP to copy it up. Particularly when I’m playing around with grabbing wordpress themes and things like that.
You can use curl to create a super simple twitter client.
For downloading files, I prefer wget.
Full Disclosure: I use Linux – not Cygwin.
If you play it right you can go check most everything you want with some fancy cURL-ing. Cygwin is the new iGoogle….
@David: BTW… you get Ubuntu running? Let me know what you think.
Hi. As I understand you use cygwin, am i right?…..So I ask you for help….I want to install cygwinn , but it isn’t complete so there are packages that cann’t be known in process of installing and postinstalling error occurs saying that these packeges ( for ex. brltty.sh exit cod1) aren’t known. what can I do. Please response if you can help. Thanks.
@Eric: I’ll IM you about the Ubuntu. Trouble was afoot…
Isn’t wget better :) ? Personally I prefer some unix platform, where these great tools are installed by default, bash is better than cmd etc. At the moment I’m using mac … Windows for web testing can run there through virtualization, that’s no problem …
@Botanicus: Don’t ruin tomorrow’s post, Bot!
AFAIK, both curl and wget use the same underlying libraries.
Also, until wget added the new -s options, curl was the only way to retrieve https documents.
“Why should I open Firefox, type in the address, deal with the ads, and click 5 links before I can get to what I want when I can use command line to download what I want?”
Because you don’t know the URL of every file that exists on the internet. Using these commands can be useful, but will never be able to replace a web browser for downloading files.
http://letitbit.net/download/48739.42de19a0b58fc2849748f5dd47de/aj-q___la-quinto_-_dozhd.mp3.html
How can use Cygwin to compile & build files ??