CURL Mini Tutorial

Curl command is used to transfer files to and from a server, it supports a number of protocols like HTTP, HTTPS, FTP, FTPS, IMAP, IMAPS, DICT, FILE, GOPHER, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP etc.

Curl also supports a lot of features like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer pause & resume, etc. There are around 120 different options that can be used with curl.

To download a file using CURL from http or ftp or any other protocol, use the following command:


If curl can't identify the protocol being used, it will switch to http. We can also store the output of the command to a file with -o option or can also redirect using >:

curl -o file.html


curl > file.html

Download Multiple Files

To download two or more files with curl in a single command, we will use -O option. Complete command is,

curl -O -O

Using FTP With Curl

To browse a ftp server, use the following command,

curl –user username:password

To download a file from the ftp server, use the following command,

curl –user username:password -o file.tar.gz

To upload a file to the ftp server using the curl command, use the following,

curl -T ftp:/ –user username:password

Resume a Paused Download

We can also pause and resume a download with curl command. To do this, we will first start the download ,

curl -O

Then we can pause the download using ctrl+C and to resume the download, use the -C option:

curl -C – -O

Sending an Email

Though you might not be using it any time soon, but none the less we can use curl command to send email. Complete command for sending an email is,

curl –url “smtps://” –ssl-reqd –mail-from “” –mail-rcpt “” –upload-file mailcontent.txt –user “” –insecure

Limit Download Rate

To limit the rate at which a file is downloaded, in order to avoid network choking or for some other reason, use the curl command with –limit-rate option,

curl –limit-rate 200k -O

Show Response Headers

To only see the response header of a URL & not the complete content , we can use option -I with curl command,

curl -I

This will only show the headers like http protocol, Cache-control headers, content-type etc of the mentioned url.

Using HTTP Authentication

We can also use curl to open a web url that has http authentication enabled with curl using -u option. Complete command is,

curl -u user:passwd

Using a Proxy

To use a proxy server when visiting an URL or downloading, use -x option with curl,

curl -x

Verifying SSL Certificate

To verify a SSL certificate of an URL, use the following command,

curl –cacert ltchlb.crt

Ignoring SSL Certificate

To ignore the SSL certificate for an URL, we can use -k option with curl command,

curl -k
{{ message }}

{{ 'Comments are closed.' | trans }}