Linux Curl Command Guide
Introduction
Curl is a command-line tool for transferring data with URLs. It supports various protocols including HTTP, HTTPS, FTP, and more.
Usage
To transfer data, use the following command:
curl [options] [URL]
Common Options
-o <file>: Save the output to a file.-I: Fetch the HTTP headers only.-L: Follow redirects.-d <data>: Send data in a POST request.
Examples
-
Download a file:
curl -o file.zip https://example.com/file.zip -
Fetch HTTP headers:
curl -I https://example.com -
Follow redirects:
curl -L https://example.com -
Send a POST request with data:
curl -d "param1=value1¶m2=value2" https://example.com/submit