CURL Command: It is a Linux Terminal Command mainly used to transfer the data from one server to another server. This CURL Command is an useful Terminal command line utility and mainly used to download and upload from to the server. In this tutorial, We added 20+ best examples to use the CURL command effectively in Linux.
The below CURL commands are tested on Ubuntu 19.04 Disco Dingo edition and Ubuntu 18.04. There are more than 20+ CURL commands are available and it will be updated in another article.
Best CURL Linux Commands:
Follow the below commands to test the CURL commands on Linux and its distros.
Use Basic CURL Command:
The CURL is mainly used to get the content from one server to another server. You can get the source code of any websites or server by using the CURL command.
The above command will get you the Source code of the “Tecrobust.com” in the Linux terminal. This CURL command will work as a browser in the Linux terminal. Copy the above command & replace the “https://www.tecrobust.com” with your own URL or IP address.
Store File Using CURL:
You can simply store the output file from the above output by following the below command.
The CURL command will help you get the source code of the URL that you provided and adding the ” > tecrobust.html “, will help you store the source code under the filename of tecrobust.html in your Linux pc. You can replace the tecrobust.html with your own name and file format.
CURL -o Command Usage:
You can use the “-o” option to download or store the data to a specific file.
CURL -O (Capital O) Command Usage:
(Capital O) “CURL -O” will help you save the downloaded data in a file with the same name.
The above command “curl -O” will save the downloaded data in a file named ‘websites.html’.
Mute CURL Command Output:
If you want to make your terminal clear while processing the CURL commands and then you need to follow the below command to mute the CURL process. The below command will also mute the process of CURL Errors.
The above image shows that the SSL error while using the CURL command on Linux Terminal, To minimize the error just add the “-s” code with CURL. “ -s ” will minimize the error displays in the terminal.
As you see in the above image the error have been muted in the terminal. If you want to see the error run the same command but add the “-S” ( Capital S) with the command and execute.
The above image shows CURL with errors. Simply use the “-s -S” along with CURL.
Store/Download Multiple Files From Website or Server:
By using the CURL you can able to store or download data from more than one websites. Just simply follow the below commands to enable multiple downloads using CURL command.
You can use the -o or -O to download multiple files using CURL.
URL 301 Redirect Using CURL:
Website nowadays having SSL encryption to maintains the user data security and so every website has HTTPS connection nowadays. Before this, website only having the port 80 connection ( HTTP ) only. If you are familiar with only HTTP connection and CURL will throw you the Redirection error instead of downloading the file.
To minimize this error, -L command line option. This command will handle your 301 redirection errors in terminal.
The above command will minimize the 301 error occurring on CURL action.
CURL -V Command:
You can view the full process behind the CURL operation. By simply adding the “-v” command with CURL option to view the complete process behind the CURL.
The above image shows that the usage of “-v” command with curl, which helps you to see the complete process behind the CURL operation.
- * – additional information provided by the tool.
- > – display the header data which is sent
- < – display the header data which is received
To find more information behind the CURL process we recommend you use them
--trace CURL Command:
--trace option will provide you the more information behind the CURL option.
Find Word Meaning Using DICT Protocol With CURL Command:
By using this command, you can look up for a word on the terminal using dict protocol. A dictionary server dict.org URL is passed to it.
To search a word in a specific dictionary, use the following command:
To search a word in all the dictionaries, run the following command:
Using Proxy URL to Download Data:
The above command will help you to download the data files from the proxy servers. “-x” informs the CURL need to use the proxy server to download data files.
CURL to Limit Download Rate:
The above command will limit the downloading speed of data from the download URL.
CURL to Authenticate After File Download:
The “-u” enables the password authentication after the file has been download using CURL.
Resuming Download Using CURL:
The above command can be used when you are trying to download a large file from the server or if you have a low internet connection speed and then the above command will help you resuming the download process using CURL.
Download Files from FTP Server Using CURL:
The above command will help you download the files from the FTP server. You need to provide the proper authentication username and password to download the files from FTP server.
Upload files to FTP Server using CURL:
The above command will help you upload the files onto the FTP server.
Verify SSL Connection using CURL:
The above command will help you verify the SSL Certificate of download file URL.
Ignore SSL Warning using CURL:
The above command will help you ignore SSL warning while using CURL for downloading the file from the server.
That’s it, The above 20+ CURL Linux Commands will help you to perform some important tasks in Linux Ubuntu. If you have any queries or need an update in this article and kindly contact us.
For more article, kindly visit our Homepage