curl (short for “Client URL”) is a command line tool that enables data transfer over various network protocols. It communicates with a web or application server by specifying a relevant URL and the data that need to be sent or received. curl is powered by libcurl, a portable client-side URL transfer library.
Install and use curl on centOS 8; Through this tutorial, we will learn how to install and use curl on centOS 8.
How to Install and Use Curl on CentOS 8
Just follow the below given steps to install and use curl on centOS 8:
- Step 1 – Install Curl in CentOS 8
- Step 2 – Verify Curl Installation in CentOS 8
- Step 3 – Use Curl in CentOS 8
Step 1 – Install Curl in CentOS 8
First of all, open terminal or command line and execute the following command into it to install CURL in centOS 8:
sudo dnf install curl
Step 2 – Verify Curl Installation in CentOS 8
Once the installation is finished, execute the following command on command line or terminal to verify
The output should look something like this:
curl: try 'curl --help' or 'curl --manual' for more information
Step 3 – Use Curl in CentOS 8
Let take simple example with Curl and URL. If we want to view the source code of any website, simply paste the URL of that website in the terminal, followed by the Curl command. For example, the command for viewing the source code of the Tusmake.com website would be as follows:
$ curl https://tutsmake.com
The entire source code of the tutsmake.com website will print in the terminal.
Another implementation of the Curl command is to download a file from any URL. For example, to download a file called “index.html” from the URL “www.example.com” using the Curl command, the command would be as follows:
$ curl -O http://www.example.com/index.html
Through this tutorial, we have learned how to install and use curl on centOS 8.