Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux curl command

Transfer data to or from a URL; -I requests response headers only.

curl manual

Syntax

Command form
curl [OPTION]... URL...

Common options

8 options
OptionWhat it does
-I, --headFetch response headers only.
-L, --locationFollow HTTP redirects.
-o FILE, --output FILEWrite response data to FILE.
-O, --remote-nameSave using the remote filename.
-H, --header HEADERAdd a request header.
-d, --data DATASend request data (often used for POST).
-f, --failReturn an error for HTTP error responses without outputting the error page.
-sS, --silent --show-errorHide progress while still showing errors.

Usage examples

2 examples

Transfer data to or from a URL; -I requests response headers only.

curl -I https://example.com

Save a successful response to a file and report errors.

curl -fsS https://example.com/data.json -o data.json

Notes

curl can send data and change remote state as well as download files. Check the URL, headers and request method before using -d or -X.