How To Install And Use Curl On Ubuntu 18.04
In this tutorial, we will show you how to install Curl on Ubuntu 18.04.
You are following a tutorial where a file is downloaded using the curl utility. You run the command and you get the following error message curl command not found. There’s nothing to worry about, this simply means that the curl package is not installed on your Ubuntu machine.
Curl is a command line tool that allows you to transfer data from or to a remote server. With curl, you can download or upload data using one of the supported protocols including HTTP, HTTPS, SCP , SFTP , and FTP.
Installing Curl on Ubuntu
Curl package is included in the default Ubuntu 18.04 repositories. The installation is pretty straightforward, just type:
To verify that curl has been installed, type curl in your terminal, and press Enter:
The output will look something like this:
That’s it! At this point, you have successfully installed curl on your Ubuntu system.
In its simplest form when used without any option, Curl will display the resource specified in the [url] to the standard output.
For example, the command below will print the source-code of the example.com homepage in your terminal window:
To download a file with Curl you can use either the -o or -O options.
Lowercase -o allows you to specify the name of the file you are downloading:
Uppercase -O will save the file with its original filename:
Another useful feature of Curl is its ability to fetch only the HTTP headers of the specified URL:
With curl you can also download files from password protected FTP servers:
You have successfully installed Curl on your Ubuntu system. For more information about the most commonly used curl options.