[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedMay 29, 2023

How to Install and Use Curl on Ubuntu 18.04

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:

sudo apt install curl

To verify that curl has been installed, type curl in your terminal, and press Enter:

curl

The output will look something like this:

curl: try 'curl --help' or 'curl --manual' for more information

That’s it! At this point, you have successfully installed curl on your Ubuntu system.

 

Using Curl

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:

curl https://example.com

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:

curl -o linux.tar.xz https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.5.tar.xz

Uppercase -O will save the file with its original filename:

curl -O https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.5.tar.xz

Another useful feature of Curl is its ability to fetch only the HTTP headers of the specified URL:

curl -I https://www.ubuntu.com/
HTTP/1.1 200 OK
Date: Tue, 02 Apr 2019 20:47:44 GMT
Server: gunicorn/19.9.0
Strict-Transport-Security: max-age=15768000
X-Hostname: juju-prod45-ubuntu-website-machine-15
Content-Type: text/html; charset=utf-8
Age: 42
X-Cache: HIT from privet.canonical.com
X-Cache-Lookup: HIT from privet.canonical.com:80
Via: 1.1 privet.canonical.com (squid/3.5.12)

With curl you can also download files from password protected FTP servers:

curl -u FTP_USERNAME:FTP_PASSWORD ftp://ftp.example.com/file.tar.gz

 

Conclusion

You have successfully installed Curl on your Ubuntu system. For more information about the most commonly used curl options.

Keep reading
How to understand critical system services.
September 14, 2023

How to understand critical system services.

How To Understand Critical System Services In Linux. Linux, being an open-source and highly customizable operating system, relies on various services and daemons to perform essential functions. These services handle everything from system initialization to managing network connections and user…

Read article
How to understand are Linux Daemons.
September 14, 2023

How to understand are Linux Daemons.

What Are Linux Daemons. A daemon (usually pronounced as: day-mon, but sometimes pronounced as to rhyme with diamond) is a program with a unique purpose. They are utility programs that run silently in the background to monitor and take care of certain subsystems to ensure that the operating system…

Read article
How to understand linux logs.
September 14, 2023

How to understand linux logs.

How To Understand Linux Logs. Linux logs provide a timeline of events for the Linux operating system, applications, and system and are a valuable troubleshooting tool when you encounter issues. When issues arise, analyzing log files is the first thing an administrator needs to do. How can Linux…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00