How to download files using cURL?

Downloading files using the cUrL command

The cUrL (Client URL) is a command-line service and a library for sharing files between different systems.

Unix-like operating systems tend to install the curl command function by default as it supports multiple network protocols (However such as HTTP, FTP, SFTP, etc.)

However, When you are downloading files to your system, using the cUrL is a wise option because of its availability, proxy support, HTTP post, etc.

After that Will show you how you can use the curl command to download files from a network.

The simple syntax of downloading a file using the curl command is:

If the cUrL command line does not install by default, follow the method given below:

To install curl on Linux/ Unix

Usually, curl installed in the operating system by default, but what if it doesn’t?

We can install the curl command as follows:

Curl command for PC

We can verify the cUrL command’s installation and its current version by using this command:

  • $curl ––version

Downloading file using the cUrL

To download a file from a web server, we use:

computer

Therefore, In the above syntax –output or -o allows the user to change or rename the downloaded file.

If the user doesn’t provide the specific name to the downloaded file, Similarly the cUrL will display it on the output screen.

  • We can also use this command to download a file:

curl https://www.example.com/sticker.txt

Therefore, with the above cUrL, Similarly, you can download any file from any web server easily.

After the file is successfully downloaded, this screen will be shown:

artile

This information will displays on our screens after downloading a text file from a web server.

  1. % Total Total size of the recently downloaded file (if written).
  2. % Received a Total number of bytes that recently download.
  3. Xferd % Total number of bytes that recently upload.
  4. Average Dload According to the number of bytes per second, Similarly it is the normal transmission speed of the downloaded file.
  5. Speed Upload According to the number of bytes per second, it is the normal transmission speed of the uploaded file.
  6. Time Total According to the hours, minutes, and seconds system, it is known as the estimated time to complete the transfer.
  7. Time Spent: According to the hours, minutes, and seconds system, it is known as the time spent since the beginning of the transmission.
  8. Time Left According to the hours, minutes, and seconds system, it is known as the estimated time left to complete the transfer.
  9. Current Speed According to the number of bytes per second, it shows the normal transmission speed in five seconds. The earliest five seconds of data transmission concentrated in a shorter period.