Back to commands

Apple Terminal

Read-only

Check 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.

demo@lab:~$

$ 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

  1. printf '%s\n' 'HTTP/2 200' 'content-type: text/html' 'cache-control: max-age=300'
  2. 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

Hosting Operations Read-only

Inspect Response Headers

The page loaded, but the headers told the operational story.

curl -sI https://example.com
Web Server Rescue Read-only

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
Apple Terminal Can be slow

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
Hosting Operations Read-only

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.

  • lpic1:109-networking
  • lfcs:networking
  • linuxplus:provisional
  • linuxplus:troubleshooting
  • risk:macos-only
  • risk:read-only

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.