How to install and use Curl on CentOS 8

curl is a powerful command line tool, mainly used to transfer data between local and remote servers. Using curl you can download or upload data using various protocols, such as: HTTP, HTTPS, SCP, SFTP, and FTP.

If you try to use curl to download a file and get an error message, "curl command not found", it means that the curl package is not installed on your CentOS machine.

This article provides instructions on how to install and use the curl command on CentOS 8.

1. Install curl on CentOS

The Curl package is available in the CentOS 8 source repository. To install it, run the following command:

sudo dnf install curl

Once the installation is complete, verify it by typing curl in the terminal:

curl

The output should look like this:

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

that's it! curl has been installed on your CentOS system, and you can start using it.

Second, use curl

When you do not use any options, curl will print out the source code of the provided URL:

curl https://example.com

When you want to use curl to download a file, use the -o or -O option and add the URL address after the file name.

The lowercase -o allows you to specify the name of the saved file:

curl -o linux.tar.xz https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.3.tar.xz

The uppercase -O saves the file using the source file name.

curl -O https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.3.tar.xz

When using the -I option, curl will print out the HTTP header information of the provided URL:

curl -I https://www.centos.org/
HTTP/1.1200 OK
Date: Thu,13 Feb 202022: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 202017:21:08 GMT
ETag:"5421-59deb7fadfdfd"
Accept-Ranges: bytes
Content-Length:21537
Content-Type: text/html; charset=UTF-8

Using curl you can also download files from a password-protected FTP server:

curl -u FTP_USERNAME:FTP_PASSWORD ftp://ftp.example.com/file.tar.gz

Three, summary##

curl is a versatile tool that allows you to send or receive data over the network.

To learn more about how to use this tool, browse: Curl Command Examples.

Recommended Posts

How to install and use Curl on CentOS 8
How to install and use Docker on CentOS 7
How to install and use Curl on Ubuntu 18.04
How to install and use Composer on CentOS 8
How to install and use Cockpit on CentOS 8/RHEL 8
How to install and configure Elasticsearch on CentOS 7
How to install and use Docker on Ubuntu 20.04
How to install and configure VNC on CentOS 8
How to install and use Composer on Ubuntu 18.04
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install and use Composer on Ubuntu 20.04
How to install and use BaasBox on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and configure Owncloud on CentOS 8
How to install and uninstall tomcat on centos
How to install and use Docker on Ubuntu 16.04
How to install and configure Redmine on CentOS 8
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install and use MySQL Workbench on Ubuntu 18.04
How to install and configure NFS server on CentOS 8
How to install and configure Postfix mail server on CentOS8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
R&D: How To Install Python 3 on CentOS 7
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0