Learn to use cURL program
cURL is a tool that is used to transfer data from or to a server, with the help of using one of the protocols from DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, POP3, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP.
This article will explain how to use the cURL program to transfer files from the command line.
# When to use cURL?
The cURL tool is the most convenient way to transfer files fast from the command line. For instance, you can use cURL to download files straight to your account rather than utilizing an FTP program to download and transfer files to your account if you need to download a.zip or.tar.gz file for your project that contains a code library.
#Using CURL
To use cURL log in to your hostvento account using SSH, and then type the following command :
curl
Still, you will have to download a page from the example.com test domain :
curl -O http://example.com/test.html
The page will be downloaded to the current working directory by cURL. When cURL is given the -O option, it downloads the output and saves it in a file with the same name as the source document. It’s test.html over here. Thus, the HTML source page for example.com/test.html will be displayed to you if you open the test.html file on your account.
Use the -o option if you wish to download a file and give it a specific filename. For instance, you would type the following command to download the example.com/test.html file to a file called download.html on the local account:
curl -o download.html http://example.com/test.html
These are just the basic commands. There are more options available in cURL program and to learn them type the following command :
man curl