When using the Terminal, there are usually two options for downloading files, using wget and using cURL to download files.
Of course, both have their own advantages and disadvantages, but cURL is typically used for downloading, especially in application installation tutorials.
However, if you want to try using cURL, here we will discuss a list of common commands used to download files using cURL.
Using cURL to Download Files Without Changing the Name
First, you can use cURL to download files without changing the name of the downloaded file. For example, if we are going to download a file from https://sin-speed.hetzner.com/100MB.bin, then the file will be saved as 100MB.bin.
To do this, you can add the parameter -O (capital O)
curl -O https://sin-speed.hetzner.com/100MB.binUsing cURL to Download Files With a New Name
If you can use the capital O parameter to keep the name, you can use the lowercase o parameter to specify a new name, for example
curl -o wpgan-curl.bin https://sin-speed.hetzner.com/100MB.binDownloading Files from a Redirect
To download a file from a redirect, for example when you download WordPress, you will usually use the link https://wordpress.org/latest.zip, then you can use the parameter -L
curl -LO https://wordpress.org/latest.zipYou can also use the parameter -o to specify the name of the file to be saved
curl -Lo wordpress.zip https://wordpress.org/latest.zipDownloading Files While Ignoring SSL
If the website you are accessing does not have SSL, you will usually get an error curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it.
To overcome this, you can use the parameter -k (lowercase k)
curl -kLO https://wordpress.org/latest.zipSilent Download Using cURL
As you have seen in the previous examples, every time you run a cURL command, there will be information such as Average Dload, Speed Upload, Time Total, Time Spent, and others.
If you want to hide that information when using cURL, you can use the parameter -s (lowercase s)
curl -so wpgan-silent-curl.bin https://sin-speed.hetzner.com/100MB.binThat is the list of commands you can use if you want to use cURL to download files. For other parameters that can be used, you can check them with one of the following commands
curl --helpcurl -hcurl --manual
COMMENTS
Loading...