How to fix: curl command not found an error

CURL also known as cURL or client URL is a command-line utility used to transfer/download data using various network protocols such as HTTP, FTP, SCP, POP3, SMTP, etc. This command is designed to operate without any interaction with the user. Curl command comes with several features, some of them are given below:

  • This command can be used to resume file transfer 
  • Assists in modifying the bandwidth
  • Curl also supports proxy
  • FTP uploading
  • User Authentication

But this command-line tool does not come out of the box with Ubuntu, therefore most new users get the following error using the curl command:

curl command not found

In this guide we will learn how to get rid of this error in Linux:

How to fix “curl command not found error”

To fix this error we need to install the curl command tool and to get it to use the command given below:

$sudo apt install curl

And to verify if the curl is installed or not use:

$curl –version

Follow the below-mentioned procedure to understand the basic use of this command:

How to use curl command in Linux

Now let’s check the usage of this command. To check the source of any webpage simple use

$ curl https://www.google.com/

To download any file with a user-defined name use:

$ curl -o washinsgton.png  https://images.pexels.com/photos/1796730/pexels-photo-1796730.jpeg

To download a file with its original name use capital “O”:

$ curl -O https://images.pexels.com/photos/1796730/pexels-photo-1796730.jpeg

To check the header use:

$ curl -I https://www.google.com/ 

To resume incomplete download file:

$ curl -L -O -C <URL>

Conclusion:

Curl is a key command to transfer data using any networking protocol with various unique features but by default, it cannot be found in Linux. Therefore, most of the new Linux users get a “command not found” error, and to eliminate that we need to install the curl command. And lastly, we learned the usage of this command.