Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install and Use Curl on Ubuntu 20.04 - DesignLinux

designlinux 0 Comments

curl is a command-line utility for transferring 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.

This article explains how to install Curl on Ubuntu 20.04.

Installing Curl on Ubuntu #

If you get an error message saying curl command not found when trying to download a file with curl, it means that the curl package is not installed on your Ubuntu machine.

curl is included in the default Ubuntu 20.04 repositories. The installation is pretty straightforward:

sudo apt updatesudo apt install curl

Once the installation is complete, verify it by typing curl in your terminal:

curl

The output will look something like this:

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

That’s it! You have successfully installed curl on your Ubuntu machine, and you can start using it.

Using curl #

When used without any option, curl prints the source code of the URL specified as an argument to the standard output.

For example, the following command will print the source of the gnu.org homepage in your terminal window:

curl https://gnu.org

To download a file with curl, use either the -o or -O options.

The lowercase -o option allows you to specify the name of the saved file:

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

When invoked with uppercase -O, curl saves the file with its original filename:

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

With curl you can also fetch only the HTTP headers of the specified URL:

curl -I https://www.gnu.org/
HTTP/1.1 200 OK
Date: Mon, 29 Jun 2020 07:10:35 GMT
Server: Apache/2.4.7
Content-Location: home.html
Vary: negotiate,accept-language,Accept-Encoding
TCN: choice
Strict-Transport-Security: max-age=63072000
Access-Control-Allow-Origin: (null)
Accept-Ranges: bytes
Cache-Control: max-age=0
Expires: Mon, 29 Jun 2020 07:10:35 GMT
Content-Type: text/html
Content-Language: en

Another common use case of curl is to download files from password-protected FTP servers:

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

Conclusion #

Curl is a versatile tool that allows you to send and receive data over the network. Installing Curl on Ubuntu is a pretty simple task.

For more information about how to use this tool, visit Curl Command Examples.

If you have any questions or feedback, feel free to leave a comment.

curl terminal ubuntu

Related

Tags: curl, terminal, ubuntu

The 13 Best Music Players for Ubuntu & Linux Mint

Prev Post

How to Install CouchDB on Debian 10 Buster

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 259
  • 614,631

DesignLinux.com © All rights reserved

Go to mobile version