What is Curl?

How did you open this website? Either you entered the site name 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://example.com

You can see a lot of content output on your computer screen. This is page source of the homepage of this website.


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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s