Download at the Speed of Typing With the cURL Command

Download at the Speed of Typing With the cURL Command

These days starting any front-end tinkering you’re likely to go down a rabbit hole just getting the frameworks set up and included in your HTML file. Do you go with Grunt, Gulp, Bower? How do you just jump in as quickly as possible?

Well, nothing’s quicker than going to cdnjs, finding your library, then typing this into a terminal:

> curl -O https://cdnjs.cloudflare.com/ajax/libs/react/15.2.1/react.min.js

Then pasting a link to that file into your HTML. So fast and easy. You could set yourself up with a handy bash command that uses cURL to download some of your go-to includes. Leave the headache for cases that really need it.

Anything else on the internet you feel like downloading and download routinely? Just include a cURLcall, or a series of them, in a shell script.

The cURL command, can do a lot more than download (which it does with the -O flag). It can fetch information about servers, data from webpages, even post data to a webform.

By the way, you can download a whole website from the command line, but for that you’d use wget. And for more sophisticated web scraping you’d want to use other tools, like Beautiful Soup.

More:

cURL Chapter from ‘Conquering the Command Line’

10 Useful Things You Can Do With cURL