curl
TLDR
Download file
SYNOPSIS
curl [options] [URL...]
DESCRIPTION
curl is a command-line tool for transferring data with URLs. It supports HTTP, HTTPS, FTP, and many other protocols, making it essential for web development, API testing, and file transfers.
The tool is ubiquitous in scripts, CI/CD pipelines, and system administration.
PARAMETERS
-O, --remote-name
Save with remote filename-o, --output file
Save to specified file-L, --location
Follow redirects-X, --request method
HTTP method (GET, POST, PUT, DELETE)-d, --data data
Send POST data-H, --header header
Add custom header-u, --user user:pass
Authentication-I, --head
Fetch headers only-v, --verbose
Verbose output-s, --silent
Silent mode-f, --fail
Fail silently on HTTP errors-k, --insecure
Allow insecure SSL connections
COMMON USES
Download file:
curl -o myfile.zip https://example.com/download
curl https://api.example.com/users
# POST JSON
curl -X POST \
-H "Content-Type: application/json" \
-d '{"name":"John","age":30}' \
https://api.example.com/users
# With authentication
curl -u username:password https://api.example.com/data
curl -I https://example.com
# Custom headers
curl -H "Authorization: Bearer TOKEN" \
https://api.example.com/secure
FEATURES
- Multiple protocols (HTTP, HTTPS, FTP, SFTP, etc.)
- Authentication (Basic, Digest, OAuth, etc.)
- Cookie support
- Proxy support
- SSL/TLS
- Rate limiting
- Resume transfers
- Multiple simultaneous transfers
CAVEATS
Silent failures by default (use -f to change). Large downloads show progress by default (use -s for scripts). Cookie files need management. SSL certificate issues require -k (insecure). Complex syntax for advanced features.
HISTORY
curl was created by Daniel Stenberg in 1997 (originally httpget), becoming one of the most widely used command-line tools for data transfer.


