Apple Terminal
Read-onlyCheck a URL Without Downloading the Page
A developer needs to confirm whether a local or remote URL returns the expected status, redirect, or content type.
Command
curl -I https://example.com
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use when the server handles HEAD differently from GET. In that case, use curl -i.
Expected output
HTTP status line and headers such as content-type, cache-control, and location.
System impact
Read-only. Nothing changes locally. The command makes a HEAD request and prints response headers.
Recovery / rollback: no state is changed.
When to use it
Use for quick checks of local dev servers, redirects, CDN headers, and status codes.
When not to use it
Do not use when the server handles HEAD differently from GET. In that case, use curl -i.
Explanation-only example
Illustrated output, not a live lab run
This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.
$ printf '%s\n' 'HTTP/2 200' 'content-type: text/html' 'cache-control: max-age=300'
HTTP/2 200
content-type: text/html
cache-control: max-age=300
$ printf '%s\n' 'HTTP/2 301' 'location: https://example.com/' | awk 'BEGIN{IGNORECASE=1} /HTTP|location|content-type|cache-control/'
HTTP/2 301
location: https://example.com/
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
printf '%s\n' 'HTTP/2 200' 'content-type: text/html' 'cache-control: max-age=300'printf '%s\n' 'HTTP/2 301' 'location: https://www.example.com/' | awk 'BEGIN{IGNORECASE=1} /HTTP|location|content-type|cache-control/'
next steps
Related commands
Your Site Is Not Down. DNS Might Be Lying.
The browser said the site was gone. The server was answering fine.
curl --resolve example.com:443:203.0.113.10 https://example.com/
Inspect Response Headers
The page loaded, but the headers told the operational story.
curl -sI https://example.com
Smoke Check an HTTP Status
A deploy is not done until the endpoint answers.
curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/health
Find Large Files Inside a Project
Before committing, check whether a huge video, build artifact, or export slipped into your repo.
find . -type f -size +100M -print
Check HTTP to HTTPS Redirect
HTTPS worked. The plain HTTP redirect still mattered.
curl -I http://example.com
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.