Install and Use Curl Command on Ubuntu 20.04 - Step by step process to implement it ?

Curl is a command-line tool that is used frequently by Linux users. It is a useful utility that can be used to transfer data to or from a remote server.

The curl command supports many protocols: HTTP, HTTPS, SMTP, SCP, FTP, and so on.

This tool is designed for automatic operation, it can be used without user interaction.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform cURL related queries on Ubuntu Linux Server.

In this context, we shall look into how to install Curl command on your Ubuntu 20.04 machine.


How to install Curl on Ubuntu 20.04 ?

To begin, ensure that you perform this procedure as the root user with sudo rights.

Then, Open the terminal and enter the following command:

$ curl

If the output shows that:

Comand 'curl' not found, but can be installed with:
sudo apt install curl

Then this means that curl is not installed on your Ubuntu 20.04 machine.

You can install the curl by running:

$ sudo apt update
$ sudo apt install curl

To verify whether the curl is successfully installed, run:

$ curl --version


Working with cURL on Ubuntu ?

The most basic way to use the curl command is to run it without any option.

The curl will display the source content of the target URL.

For example:

$ curl https://linuxapt.com

If you want to download files from remote servers with the curl command, let's use the -o or -O options:

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

To fetch only the HTTP headers, use the -I option:

$ curl -I https://linuxapt.com

To transfer files via FTP protocol, you can use the curl command with the -u option and pass the username and password as shown below:

$ curl -u Ftp-user:Ftp-password ftp://ftp.domain.com


[Need urgent assistance in fixing missing packages on Ubuntu Linux system? We are available to help you today. ]

This article covers how to set up curl command on your Ubuntu 20.04 LTS machine. curl command is a tool to download or transfer files/data from or to a server using FTP, HTTP, HTTPS, SCP, SFTP, SMB and other supported protocols on Linux or Unix-like system.


To Install cURL for Ubuntu Linux:

1. Update your Ubuntu box, run: 

$ sudo apt update && sudo apt upgrade

2. Next, install cURL, execute: 

$ sudo apt install curl

3. Verify install of curl on Ubuntu by running: 

$ curl --version

Related Posts