How to install and use Curl on CentOS 8

Curl is a command-line utility for transferring data to or from a remote server. It allows you to download or upload data using HTTP, HTTPS, SCP, SFTP and FTP protocols.

If you try to download files using curl And you get an error message that says curl command not found, Which means the curl package is not installed on your CentOS system.

This guide describes how to install and use commands curl On CentOS 8.

Install Curl on CentOS

Deal curl Located in the default CentOS 8 repository, to install it, run the following command:

sudo dnf install curl

To check it out curl Installed, type curl At the terminal and press Enter:


The command will print the following output:

curl: try 'curl --help' or 'curl --manual' for more information

At this point, you have successfully installed curl on your Debian machine, and you can start using it.

Start using Curl

When used without any options, curl will print the specified URL source code as an argument for standard output, for example:


To download files with curl, use the -o or -O.

Selection -o (The letter o in lowercase) allows you to specify the name of the saved file

curl -o linux.tar.xz

Selection -O (Capital o) will save the file with its original name:

curl -O

Another useful feature of Curl is its ability to display HTTP headers from a specified URL:

curl -I
HTTP/1.1 200 OK
Date: Thu, 13 Feb 2020 22:01:04 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Last-Modified: Thu, 06 Feb 2020 17:21:08 GMT
ETag: "5421-59deb7fadfdfd"
Accept-Ranges: bytes
Content-Length: 21537
Content-Type: text/html; charset=UTF-8

With Curl, you can also download files from a password-protected FTP server:



Curl is a versatile tool that allows you to send and receive data over the network. Installing Curl on Debian is a fairly simple task.

See also  How to install LibModsecurity WAF app on Nginx CentOS 8

For more information on how to use this tool, visit Examples of Curl Command


Source link

Originally posted 2020-11-18 14:58:26.

About wahyuway

Check Also

How To Install PHP 8.0 on Amazon Linux 2

PHP 8.0 is a major release of the PHP programming Language mostly used in the Development …

Leave a Reply