Sunday, June 5, 2016

Curl Command and its attributes



curl -L -o donation.zip http://bit.ly/1Aoywaq

http://bit.ly/1Aoywaq is the URL of a zipped file "donation.zip"
 Donation.zip contains multiple zipped files (block_1.zip to block_10.zip) along with a documentation and a csv file that stores the frequency count.
donation.zip : destination filename mentioned in the command line, where the downloaded fill will get saved

-o:

curl command is used to download a file from a particular URL. We can save the result of the curl command in a file with attribute -o/-O
-o  (lowercase o) : result will be saved in the file name mentioned in the command line
-O (Uppercase O) : result will be saved in the filename taken from the filename mentioned in the URL

-L : 

If the source file is moved to some other location, then an HTTP location header is send as the response to the curl command. If we mention -L as an attribute in the command line, curl will take the HTTP location header and follow the new location to get the file.

Alternative of curl command is the wget command which is also used to download the offline page of a particular URL.




No comments:

Post a Comment