Linux cURL Command

Linux cURL Command

cURL Commands:

cURL is a simple software package that consist of a command line tool for sending or receiving data using URL. It is a simple to use command line tool for sending and receiving files that supports the all main protocols that are FTP, GOPHER, HTTP, FTPS, HTTPS, DICT, IMAP, LDAP, IMAPS, POP, RTMP, SCP, RTSP. SMTP,TELENT, SMTPS, TFTP, LDAPS, and POP3S. You can use cURL into the shell script. It have 120 command line tool. It has the extra feature to resume and pause of downloads. It supports the all major operating system. cURL command line supports the configuration files. You can upload multiple files with single command. You can download the multiple files at same time with the use of cURL Command. cURL commands use the same TCP for downloading the files.

cURL Commands with Examples :

1. For Downloading Single File:

The command is used to download the content of URL and display it on your terminal.


$ curl

2. Saving the cURL Output to File:

You can save the url output in a file using the following command. You can save the output by using –o/- O options with cURL command.


$ curl – o mytext.html

By using above command you can save the mytext file in the mygettext.html.

3. Fetching the multiple file at same Time:

You can download files at the same time using the given command.


$ curl – o URL1 – o URL2

4. Redirects the HTTP Location Headers with – L option:

Curl doesn’t follow the location of http header. When a web page that is requested is moved one place to another then it will be sent the http header location like response. Curl redirects the HTTP header location.

For instance when you type in your browser in India then it will be redirects to automatically. It is done by simply applying the given command:


$ curl

<Title> 302 moved</Title>

<H1> 302 moved </H1>

Document has moved

< a href => here</a>

It will show the output is the requested document is moved on

5. Start Resume Download:

In some case when you need to download a large file and the download is stopped in between for some reason. If you want to download the file where it is stopped then you can use the command curl with – C option.

For Instance you have to start the download a file and stop it in between by using the Ctrl – C


$ curl - o

########## 18%

After that you can execute curl command with – C option for start downloading from where you stop that.


Curl – C - - o httpl://

######### 19%

6. Set Limit of Data Transfer:

You can also set the limit of data transfer rate via using the curl command with limit rate option. You can set the average data transfer rate that is 1000 bytes per second. For set the limit follow the given command.


$ curl - - limit – rate 1000B –0

7. Passing Authentication in cURL:

In some case, website needs username and password for viewing the content than you can use the curl with – u option.


$ curl – u username: password

8. Downloading files from FTP Server:

If you want to download files from FTP server then you can use the given command .


$ curl – u ftpuser: ftppass –o fttp:// ftp_server/public_html/xss.php.

9. Getting the Information of a Word:

You can get the information about a word via using the cURL DICT protocol. For getting definition of word you have to pass the url of dictionary Server to the DICT protocol.


$ curl dict://

10.Downloading a File Using Proxy:

You can download a file from proxy by simply defining the cURL to use the proxy for downloading the file. Follow the given command.


$ curl – x
First release
Last update
0.00 star(s) 0 ratings