Inspect HTTP response headers with curl
Send a HEAD request to any URL and print the status line, server, content type, caching, and redirect headers.
01Command
$ curl -I https://example.com02What it does
curl -I issues a true HEAD request, so you see headers like Content-Type, Cache-Control, and Location without transferring the body. Some servers respond differently to HEAD than GET; to see headers from a real GET, use curl -s -o /dev/null -D - URL, which discards the body and dumps headers to stdout. Follow redirects by adding -L to trace a full chain (each hop's headers appear in order), and check TLS details with -v. Pair with -H 'Header: value' to add request headers when testing an API or cache behavior.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- curl(1) — transfer a URLEvidence: The curl man page documents -I / --head as fetching the HTTP headers only, using the HEAD method.
- curl man page — official documentationEvidence: The official curl documentation describes --head as fetching headers only and -o / --output for discarding or redirecting the body.
Last verified: 2026-09-17 · Category: Network
06Related solutions
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.
Show every TCP and UDP socket in listening state with the owning process name and PID — the modern replacement for netstat.
Query any DNS record type for a domain, with a compact answer or the full response including headers and TTLs.