YouTube Icon

Code Playground.

How to Install and Use Curl on Ubuntu 18.04

CFG

How to Install and Use Curl on Ubuntu 18.04

You are following an instructional exercise where a document is downloaded utilizing the twist utility. You run the order and you get the accompanying mistake message twist order not found. There's nothing to stress over, this essentially implies that the twist bundle isn't introduced on your Ubuntu machine. 

Twist is an order line apparatus that permits you to move information from or to a far off worker. With twist, you can download or transfer information utilizing one of the upheld conventions including HTTP, HTTPS, SCP , SFTP , and FTP . 

In this instructional exercise, we will tell you the best way to introduce Curl on Ubuntu 18.04. 

Installing Curl on Ubuntu

Twist bundle is remembered for the default Ubuntu 18.04 storehouses. The establishment is pretty direct, simply type: 

sudo apt install curl

To check that twist has been introduced, type twist in your terminal, and press Enter: 

curl

The yield will look something like this: 

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

That is it! Now, you have effectively introduced twist on your Ubuntu framework. 

Using Curl

In its least difficult structure when utilized with no choice, Curl will show the asset indicated in the [url] to the standard yield. 

For instance, the order beneath will print the source-code of the example.com landing page in your terminal window: 

curl https://example.com

To download a record with Curl you can utilize either the - o or - O choices. 

Lowercase - o permits you to indicate the name of the record you are downloading: 

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

Capitalized - O will spare the record with its unique filename: 

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

Another valuable component of Curl is its capacity to get just the HTTP headers of the predetermined 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)
curl -u FTP_USERNAME:FTP_PASSWORD ftp://ftp.example.com/file.tar.gz

Conclusion

You have effectively introduced Curl on your Ubuntu framework. For more data about the most normally utilized twist choices, check Curl Command Examples . 

On the off chance that you have any inquiries or input, don't hesitate to leave a remark.




CFG