Linux curl command Help and Examples

Curl is the most important command-line tool in Linux / UNIX for transfer data to or from a server using various protocols.

Nowadays all most all IT people use curl utility to their work either system adminstrator or developer. It is use under verious script to do work automation and at the same time developer also  use curl utility in the appllication development to get data from different servers or remote host by using various protocols.

Most common supported protocols to curl utility are HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, Telnet, LDAP, etc.

Curl has capabilities to transfer multiple files at once, so we are using it as very reliable tool for data transfer or featching from different location or remote location.

We can do many more thing using curl utility using various options.

Suggested Reading: curl command Structure

Curl command Syntax:

$  curl  [option]  [url…]

Examples of curl uses:

Download a single file

You can download a file from internet using protocol http, https, FTP, etc. with the curl command.

To download a file from the internet, you can use curl with the option “-o,” and it will download and save the file into your current working directory with the same name an in the remote server.

# curl -O https://linuxconcept.com/pdf_doc.tar.gz

Download multiple files

You can also download multiple files using CURL using the same option “-o” with all files, as shown below:

# curl -O https://linuxconcept.com/pageinfo.html -O https://linuxconcept.com/about_us.html

Use Proxy to download a file

Sometimes you use the proxy to surf the internet, especially in office in that case also you can use the curl command to download the file. You can use CURL like below example to use the proxy network.

# curl -x proxy.linuxconcept.com:8080 -U user:proxyweb -O https://linuxconcept.com/pdf_doc.tar.gz

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

two × two =

Related Articles