curl command
Make HTTP requests, call APIs and download files.
- Downloads & file transfer
- Package curl
- 11 options · 10 examples
Syntax
curl [options] URLProvided by the curl package. Run man curl for the full manual.
Common options
| Option | What it does |
|---|---|
-o FILE | Save to a file |
-O | Save with the remote file name |
-L | Follow redirects |
-I | Headers only (HEAD request) |
-X METHOD | Request method, e.g. POST |
-H "K: V" | Add a header |
-d DATA | Send data (POST) |
-u user:pass | Basic authentication |
-s | Silent |
-k | Skip TLS certificate checks |
-w FORMAT | Print details, e.g. %{http_code} |
Examples
Fetch a page
curl https://example.comDownload a file
curl -LO https://example.com/file.tar.gzSave with a new name
curl -L -o app.zip https://example.com/downloadShow only the headers
curl -I https://example.comPrint just the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.comPOST JSON
curl -X POST -H "Content-Type: application/json" -d '{"name":"demo"}' https://api.example.com/itemsSend a bearer token
curl -H "Authorization: Bearer $TOKEN" https://api.example.com/meUpload a file (form)
curl -F "file=@report.pdf" https://example.com/uploadResume a download
curl -C - -O https://example.com/big.isoPretty-print JSON
curl -s https://api.github.com/repos/curl/curl | jq .
No example matches. Check the options table or search the guides.
Tips
-kturns off certificate checks; use it only for testing.
curl guides
- How to Use Curl Command with Proxy on Linux Networking · Updated Apr 2025
- How to Show Curl Headers in Responses & Requests Linux Commands · Updated Apr 2025
- Downloading Files with curl: A Comprehensive Guide Linux Commands · Updated Apr 2025
- 10 Useful Examples for Downloading Files using cURL Linux Commands · Updated Apr 2025
- Curl Command for POST Requests with JSON Payloads Linux Commands · Updated Apr 2025
- curl Command in Linux with Examples Linux Commands · Updated Apr 2025
- POSTing Raw Body Data using cURL (Include Examples) Linux Commands · Updated Apr 2025
- A Step-by-Step Guide to Sending Emails using cURL Linux Commands · Updated Apr 2025
