Curl
Linux Terminal Util
curl Command Reference
The curl
tool is used for transferring data to or from a server. It supports multiple protocols like HTTP, HTTPS, FTP, and more.
Syntax
Common Options
-
-A
,--user-agent
: Specify the User-Agent string. -
-b
,--cookie
: Send data as a cookie. -
-c
,--cookie-jar
: Save cookies to a file. -
--compressed
: Request a compressed response.
Data and POST Requests
-
-d
,--data
: Send data with a POST request. -
-F
,--form
: Emulate form submission. -
-T
,--upload-file
: Upload a file. -
-u
,--user
: Provide user credentials. -
-X
,--request
: Specify custom HTTP methods.
HTTP Headers and Responses
-
-I
,--head
: Fetch only the headers of the response. -
-H
,--header
: Add custom HTTP headers. -
-v
,--verbose
: Enable verbose output for debugging. -
--limit-rate
: Limit the transfer rate. -
-L
,--location
: Follow redirects.
Miscellaneous
-
-k
,--insecure
: Allow insecure SSL connections. -
-o
,--output
: Save the output to a file. -
-O
,--remote-name
: Save the output with the remote file name. -
-s
,--silent
: Silent mode, no progress or error messages. -
-w
,--write-out
: Output additional information. -
-x
,--proxy
: Use a proxy server.
Examples
-
Retrieve a Web Page
-
Save Output to a File
-
Follow Redirects
-
Upload a File
-
Use a Proxy
-
Display Only HTTP Headers