The Linux operating systems allow us different configurations to increase job options, we accomplish this by installing various commands which significantly improve the functionality of distribution, one of these is command cURL of which discuss in detail in this tutorial..
What is cURL
cURL is a command line tool and libraries with which it is possible to transfer data through a URL with various security options.
cURL supports protocols such as DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, Telnet and TFTP, SSL certificates HTTP POST, HTTP PUT, and many more.
The cURL utility makes use of command lines or scripts to carry out the transfer of data, which is why it is one of the most popular tools..
Some of its most outstanding features are:
- Supports cookies, forms and SSL.
- Compatible with configuration files.
- Multiple upload is possible through a single command.
- Includes progress bar, speed limitation and download time details
Now we are going to see how to install and use cURL in Ubuntu 20.04.
To stay up to date, remember to subscribe to our YouTube channel! SUBSCRIBE
1. Install cURL Ubuntu 20.04
The first step will be to update the repositories and packages of the system, for this we execute:
sudo apt update
After this we install cURL with the following command:
sudo apt install curl
We execute "curl" and we will see the following:
2. Use cURL Ubuntu 20.04
When using the cURL command without any option, curl will print the source code of the URL that we enter as follows:
To validate the version of cURL used we execute:
To download a file it is possible to use the parameters -o and -O, with the option -o lowercase it is possible to define the name of the saved file, for example:
curl -o file.extension http://domain.com/
Using the uppercase -O parameter, cURL stores the file with the original filename:
It is possible to access the headers of a domain with the -I parameter:
curl -I https://www.solvetic.com
Additionally we can restrict the cURL download rate with the following command. Here we have limited your rate to 1 KB.
curl --limit-rate 1K http://domain.com/file.tar.gz -O
We can list or download ranges allowing only the matching files to be downloaded:
We can also list more details of the headers with the following command:
curl -v http://www.solvetic.com
With cURL we have a complete series of options to manage every aspect of web downloads and access to full details of the URL headers, this is ideal if you need to perform support or update tasks on them.