What is cURL?
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?
Whenever you want to transfer a file quickly from the command line, cURL program is the easiest way to do so. For example, if for your project you need to download a .zip file or .tar.gz file that contains a code library of your project then with the help of cURL you can download the file directly to your account, instead of using an FTP client to download and transfer the file to your account.
#Using CURL
To use cURL log in to your MilesWeb account using SSH, and then type the following command :
Still, you will have to download a page from the example.com test domain :
cURL will download the page to the current working directory. The -O option instructs cURL to download the output and save it in a file name that already has the same name as the source document. Here it is test.html. So if you open the test.html file on your account, you will see the HTML source page for example.com/test.html.
In case you want to download a file and assign it a specific filename, use the -o option. For example, in order to download the example.com/test.html file to a file on the local account named download.html, you need to type the following command :
These are just the basic commands. There are more options available in cURL program and to learn them type the following command :