What is Curl?
How did you open this website? Either you entered JoysofProgramming.com in your browser address bar or you came here from some search engine. There are multiple ways by which you can open a website. Opening a website from the browser is one of the many ways. It is possible to open a website from the command line. You can even write a program to see the contents of a web page. There are browsers like lynx which helps you to browse any website from the command line.
Check the page source of any website. You may be wondering about page source. Every web page is written in languages like HTML and Javascript. What you see on your browser is the visual representation of the corresponding source code written in HTML or Javascript. A page source corresponds to this code.
Now as I said before, you can see the contents of a page (Contents of a website are divided into several pages. Currently what you are reading is also from a web page) from the command line. curl is a command which can be used to transfer data to and from a web server (A web server is the computer where a website is hosted).
Now open the terminal and enter the following command
curl http://joysofprogramming.com
You can see a lot of content output on your computer screen. This is page source of the homepage of this website.
<title>Joys of Programming</title> .....
With curl,you can download a webpage and even a complete website to your desktop. Now that was all about downloading. Various sites also allow you to upload your photographs, important files etc.
Curl can also be used to upload files to a webserver.
Comments:
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=17a53f1d-8ee8-4c06-a9f8-4ef7fb3aee37)