CentOS

How to Install and Use Curl in Centos 8

Curl, short for “Client URL,” is a popular command-line utility that is used to transfer data between a server and its client using various protocols, such as HTTP, HTTPS, FTP, SMTP, etc. Curl provides data security and the effortless simultaneous transfer of multiple files. This article covers the installation and usage processes of Curl on the CentOS 8 operating system.

Installation of curl on CentOS 8

The Curl package is available in the official package repository of CentOS 8, and it can easily be installed.

First, ensure that your CetnOS 8 system is up-to-date by issuing the following command:

$ sudo dnf makecache

Next, update your system by entering the command given below:

$ sudo dnf upgrade

After updating your system, install Curl from the standard package repository of CentOS 8 by entering the following command:

$ sudo dnf install curl -y

The “-y” flag will proceed with the installation. When a prompt appears, press “y” to continue the installation process.

After installing curl, issue the following command to verify the installation of Curl:

$ curl

If you obtain an output like that shown in the screenshot above, you have installed Curl successfully, and the program is running perfectly fine. We will now show you how to use Curl on your system.

How to Use Curl on CentOS 8

Let us begin using Curl with a simple URL. If you 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 LinuxHint website would be as follows:

$ curl https://linuxhint.com

The entire source code of the LinuxHint 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

After executing the above command, the “index.html” file will start to download.

Conclusion

This article showed you how to install Curl on CentOS 8 and start using it. This post contains the installation process of Curl, as well as its usage, such as getting the source code of a website and downloading a file from a website. The functionality of the Curl command does not stop here, and it provides a lot of other features to users. You can read the manual page on the official Curl website to learn more.

About the author

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.