A primer on cURL
cURL transfers data to or from a server using the HTTP, HTTPS, or FTP protocols. It supports POST
, cookies, authentication, downloading partial files from a specified offset, referer, user agent string, extra headers, limiting speed, maximum file size, progress bar, and more. cURL is useful for maintaining a website, retrieving data, and checking server configurations.
Getting ready
Unlike wget
, cURL is not included in all Linux distros; you may have to install it with your package manager.
By default, cURL dumps downloaded files to stdout
, and progress information to stderr
. To disable displaying progress information, use the --silent
option.
How to do it...
The curl
command performs many functions, including downloading, sending different HTTP requests, and specifying HTTP headers.
- To dump the downloaded file to
stdout
, use the following command:
$ curl URL
- The
-O
option specifies sending the downloaded data into a file with the filename parsed from the URL. Note that the URL...