If the file it is retrieving is a binary file, the outcome can be unpredictable. curl īut its default action is to dump it to the terminal window as source code.īeware: If you don’t tell curl you want something stored as a file, it will always dump it to the terminal window. If we point curl at a web page, it will retrieve it for us. It also lists all the protocols that it supports. The -version option makes curlreport its version. On Ubuntu, run this command to install it: sudo apt-get install curl
curl had to be installed on Ubuntu 18.04 LTS. Out of the computers used to research this article, Fedora 31 and Manjaro 18.1.0 had curl already installed.
The author of curl has a webpage that describes the differences he sees between curl and wget. And arguably, due to its superior handling of Linux pipes, curl can be more easily integrated with other commands and scripts. curl supports over 20 protocols, including HTTP, HTTPS, SCP, SFTP, and FTP.
Those responses might well be web page content and files, but they can also contain data provided via a web service or API as a result of the “question” asked by the curl request.Īnd curl isn’t limited to websites. What curl actually does is let you interact with remote systems by making requests to those systems, and retrieving and displaying their responses to you. Yes, it can retrieve files, but it cannot recursively navigate a website looking for content to retrieve. Curl satisfies an altogether different need.