1.

Explain the usage of curl command in Linux ?

Answer»

In Linux, CURL command is a tool to transfer data from or to a server. In Linux, curl command is used to test an application's endpoint or connectivity to an upstream service endpoint. It is used to determine if the application can reach another service, like a database, or to check if the service is up and running . This  command doesn’t require any user interaction.

Example:

$ curl -I -s application:5000 HTTP/1.0 500 INTERNAL SERVER ERROR

This example with an exception shows that the application can't reach server. Options used In the above command,

-I option -> shows the header information -s option -> silences the response body.

Curl command with -O option is  used to DOWNLOAD the file :

Usage :

curl -O http://knowledgehut.com/myfile.tar.gz #Save the file as tar,gz


Discussion

No Comment Found