cUrl list of the most used and pratical commands of the powerful open source networking tool

What is cUrl 

cUrl is an open source object programming language, it’s very useful in web applications where a strong inter-compatibility between protocols and documents is required. 


In particular, it avoids the developer having to use multiple programming languages, making  a single framework available in a series of functions combined between markup (HTML or JS) and computational languages (Java, C#, C++…). 


cUrl consists of a package and provides tools and a command line to operate on the NET using URL syntax. 

It supports many protocols, such as Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, DICT, FILE, FTP, FTPS, Gopher, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet e TFTP. 

The official website is where you can download the packages.
Needless to say, it runs on practically any platform. 


The commands you need to know 


Download a file 

$ curl 

To save,  

$ curl > sc-com.html 


Download a file only if it has been modified before/after a certain date 

After the date 

$ curl -z 20-Dec-14 

Before the date 

$ curl -z -20-Dec-14 


Download files via FTP 

$ curl -u ftpuser:ftppass -O ftp://ftpserver/public/abcd.php 

to download a folder, 

$ curl -u ftpuser:ftppass -O ftp://ftpserver/public/ 


Restore interrupted downloads 

to interrupt a large download you can use Ctrl+C to resume, 

curl -C - -O 


Save the output to a file 

curl -o aprettyfileNAME.html 
curl -O 

with the -O option the name will be the same as the origin 

Request multiple files at the same time 

$ curl -O URL1 -O URL2 


Limit the download speed 

$ curl --limit-rate 1000B -O 

in this case it’s limited to 1000 Bytes/s 


Download a series of files based on a character pattern 

$ curl[a-z]/ 


Follow HTTP routes via their response 

$ curl 

you can force the redirects with the -L option, 

curl -L 


Authentication via HTTP (base auth) 

$ curl -u username:password URL 


Uploading files to an FTP server 

$ curl -u ftpuser:ftppass -T filename.txt 

to load multiple files, 

$ curl -u ftpuser:ftppass -T "{file1,file2}" 


Enable Verbose mode 

simply enter the option -v, es: 

$ curl -v 


Use the DICT protocol 

$ curl dict:// 


Send an email via SMTP protocol 

$ curl --mail-from --mail-rcpt smtp:// 

afterwards you will be asked for object and body, insert them as follows, with the dot as the terminator 

Subject: Test email (subject) 

This is a body test 



Download a file via PROXY 

use the option -x 

$ curl -x 


As you can see cUrl is a very versatile and interesting bookshelf, make good use of it! 

Share on Social Media