How to download files straight from the Linux/Unix command-line interface

How do I download files straight from the command-line interface using curl?

Command:

curl url --output filename  OR  curl --output filename url
curl http://some.url --output filename.extention  OR 

curl --output filename.extention http://some.url 

OR

curl http://some.url -o filename.extention  OR

curl -o filename.extention http://some.url 
How to get a single file without giving output name

You can save output file as it is i.e. write output to a local file named like the remote file we get. use capital O.

curl -O https://some.url

Example:
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

This will download a file and save the output with a filename ‘ Miniconda3-latest-Windows-x86_64.exe ‘ in the same directory where curl command is run.

Installing curl

## Debian/Ubuntu Linux use the apt command/apt-get command ##
$ sudo apt install curl

$sudo apt-get install curl
## Fedora/CentOS/RHEL users try dnf command/yum command ##
$ sudo dnf install curl
## OpenSUSE Linux users try zypper command ##
$ sudo zypper install curl

If you find this post important, share to your friends