Command library / curl
curl
Fetch a URL from the command line
Transfers data to or from a URL — almost always used for HTTP. -I fetches headers only (fast, no body — great for checking what a server is without downloading anything), -o saves the response to a file, and -X sets the request method for anything other than a plain GET.
Practice curlUsage
Options and flags
urlthe URL to request
-I, --headfetch headers only, no response body
-o, --outputFILEwrite the response body to this file instead of the screen
-X, --requestMETHODthe HTTP method to use (default: GET)
-s, --silenthide the progress meter
Examples
curl https://example.comPrint the page's raw HTML straight to the terminal.
curl -I https://example.comJust the response headers — what server is this, what content type, is it even up?
curl -o page.html https://example.comSave the page to a file instead of printing it.
Common mistakes
This drill's answer is a quick header check straight to the screen — piping headers into a file is valid curl syntax, just not what this specific drill is asking for.