Download A File Using Cygwin and cURL

Download A File Using Cygwin and cURL

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

copycurl http://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.

copycurl http://cygwin.com/setup.exe --O cygwin-setup.exe

Great stuff. What would you use this for?

原文地址:https://www.cnblogs.com/lexus/p/2371744.html