Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

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 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 --:-- ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985