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 must be a full page URL, not just a site name.
$ curl www.knopper.net/index.htm --silent -O
- The -o option specifies the output file name. With this option you can specify only the site name to retrieve the home page.
$curl www.knopper.net -o knoppix_index.html
% Total % Received % Xferd Avg Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
100 6889 100 6889 0 0 10902 0 --:-- --:-- --:-- 26033
- The -silent option prevents the curl command from displaying progress information:
$ curl URL --silent
- The -progress option displays progress bar while downloading:
$ curl http://knopper.net -o index.html --progress
################################## 100.0%