man.lsPlain-English help for Unix commands

curl Transfer data to or from a URL

Sends a request to a URL and prints the response. It speaks HTTP, HTTPS, FTP and many other protocols. Use it to download files, check a web server, or call an API from the terminal.

Synopsis

curl [OPTION]... URL...

Common options

Option or formWhat it does
-OSave the download using the file name from the URL, in the current folder
-o FILESave the response to FILE instead of printing it to the terminal
-LFollow redirects. Without it curl stops at the first 301 or 302 response
-IFetch only the response headers (sends a HEAD request)
-s, -S-s is silent mode: no progress meter and no error messages. Add -S to show errors again, so -sS is quiet but not blind
-H HEADERAdd a request header, for example -H "Accept: application/json". Repeat it for more headers
-d DATASend DATA as the request body. This makes curl use POST unless you pick another method
-X METHODSet the request method, such as PUT or DELETE
-fFail quietly on HTTP errors (400 and above): print no body and exit with code 22

Examples

Print a page to the terminal
curl https://example.com
Download a file under its own name
curl -O https://example.com/files/report.pdf
Download to a name you choose, following redirects
curl -L -o latest.tar.gz https://example.com/download/latest
Look at the response headers only
curl -I https://example.com
Quiet download that still reports errors and fails on HTTP errors
curl -fsSL -o install.sh https://example.com/install.sh
Send JSON to an API
curl -X POST -H "Content-Type: application/json" -d '{"name":"ana"}' https://example.com/api/users

Notes

See also

Last reviewed 2026-10-07.