Linux cURL Commands: Quick Tutorial [Updated 2023]
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/Linux-curl.jpg?resize=720%2C340&ssl=1)
cURL is a command-line interface tool used to download data from the internet. It is free to use, open-source, developed, and maintained by thousands of contributors from all over the world. It supports numerous protocols such as HTTP, HTTPS, DICT, FILE, FTP, FTPS, Gopher, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, Telnet, and TFTP. Refer official website (https://curl.haxx.se/) for more details.
Click Here for Top 25 Linux Commands for Beginners
(1) Download content of the url
#curl http://allabouttesting.org
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/download-content.jpg)
(2) To save the content of the url in the html file
#curl http://allabouttesting.org > test.html
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/download-content-in-file.jpg)
It also shows statistics related to downloading speed of the content test.html of url. You can easily check the content of test.html by using cat command.
Alternatively, you can use below command for saving the content of url.
#curl -o test.html http://allabouttesting.org/what-is-unified-threat-management/
(3) Download pdf, iso image, installer file etc. from the url. In below example, we have downloaded user manual of curl command available on official website.
#curl -o test https://legacy.gitbook.com/download/pdf/book/bagder/everything-curl
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/download-pdf.jpg)
Note: Remember we can also use wget command for download the file from the internet.
(4) To see the weather report of your city
#curl http://wttr.in/delhi
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/climate.jpg?resize=1024%2C441)
(5) Download content of multiple urls at same time
#curl -o file1 www.google.com -o file2 www.yahoo.com
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/multiple-files.jpg)
(6) To check the header information of the url
#curl -I www.google.com
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/header.jpg)
(7) To continue/resume the previous download
Assume you are downloading an official usage guide of curl command. Somehow it got cancel in the middle, you can continue downloading by using -C option as mentioned below.
#curl -0 everything-curl https://legacy.gitbook.com/download/pdf/book/bagder/everything-curl
Somehow it got cancel in the middle, you can continue downloading by using -C option as mentioned below.
#curl -o everything-curl -C - https://legacy.gitbook.com/download/pdf/book/bagder/everything-curl
(8) To control the download speed of file
#curl --
limit-rate 1000B -o filename https://legacy.gitbook.com/download/pdf/book/bagder/everything-curl
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/limit-rate.jpg)
(9) To enable the verbose mode
#curl -v www.google.com
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/08/v-option.jpg)
(10) To interact with API endpoints
In below example, you can get information regarding ip address by using ipinfo.io
#curl ipinfo.io/X.X.X.X
X.X.X.X denotes the ip address.
Subscribe us to receive more such articles updates in your email.
If you have any questions, feel free to ask in the comments section below. Nothing gives me greater joy than helping my readers!
Disclaimer: This tutorial is for educational purpose only. Individual is solely responsible for any illegal act.