Curl utility is used for transfer data from or to a server using one of the supported protocols including HTTP, HTTPS, SCP, SFTP, and FTP. It can also be use to download or upload files with supported options like proxy support, resume transfer and much more. This article explains how to install curl on Debian 10 Buster.
The wget command is alternative way of
curl to transfer the files. If you are trying to use
curl command and get error message like bash: curl: command not found it means that the
curl package is not installed on your Debian System.
Step 1 – Install Curl on Debian
sudo apt install curl
Step 2 – Verify Installation
You can verify that curl is installed successfully by typing
curl in your terminal:
It should show output as below:
curl: try 'curl --help' or 'curl --manual' for more information
That’s it! You have successfully installed curl on your Debian system, and you can use it.
Step 3 – Use Curl
If you would like to view source code of any url simply follow url by
curl command and hit
You can download file using
-O flags with curl command. By using lowercase
-o option you can specify the name of the saved file as given below:
curl -o test_file.iso https://example.com/abc.tar.xz
-O (uppercase) will be used to store file with its original name:
curl -O https://example.com/abc.tar.xz
Using curl you can see the headers of any given URL. For example, if you want to show headers of
https://www.google.com/ run below command:
curl -I https://www.google.com/
It will show output as following:
HTTP/1.1 200 OK Date: Mon, 06 Jan 2020 06:08:48 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info." Server: gws X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Set-Cookie: 1P_JAR=2020-01-06-06; expires=Wed, 05-Feb-2020 06:08:48 GMT; path=/; domain=.google.com Set-Cookie: NID=195=KBv5W-rqZBmsjmBmXTM4x6zg8_zy3_4lZZPOLu1kk6c2n0xpqkLTK-Sb2VB7AX6UjRjKZaSGb8XX6gS07AcFJbFXUtVrJG3If1gbnamWeOZBcECySpzrST_GKU3HvEWWX0tBBruEE8jZvarSp59iUSa0wkRqxrgtsv8vIAJjLHw; expires=Tue, 07-Jul-2020 06:08:48 GMT; path=/; domain=.google.com; HttpOnly Transfer-Encoding: chunked Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000 Accept-Ranges: none Vary: Accept-Encoding
To get more help for
curl command type
Install Curl on Debian 10 is a pretty simple task. For more information about how to use this tool, visit Curl Command Examples.
If you have any questions or suggestion, feel free to leave comment below.