Trace every HTTP status and Location header in a redirect chain
Build a paste-ready command, then review its compatibility and effects before running it.
curl -sS -I -L <url> | awk 'BEGIN{IGNORECASE=1} /^HTTP\// || /^location:/ {gsub("\r",""); print}'Complete required fields to copy the generated command.
Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementscurlcurl must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportcurl Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsHTTP/1.1 301 Moved PermanentlyRepresentative successful output; values vary with the selected target and system state.
Known errorscurl: command not foundcurl is missing or is not available on PATH.
Verifycurl -sS -I -L {{url}} | awk 'BEGIN{IGNORECASE=1} /^HTTP\// || /^location:/ {gsub("\r",""); print}'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01curlCommandRuns the curl stage of this one-liner.
02-sSOptionConfigures curl with the -sS option.
03-IOptionConfigures curl with the -I option.
04-LOptionConfigures curl with the -L option.
05<url>ParameterA value supplied in the Fill parameters section.
06|PipelinePasses the output on the left to the command on the right.
07awkCommandRuns the awk stage of this one-liner.
08'BEGIN{IGNORECASE=1} /^HTTP\// || /^location:/ {gsub("\r",""); print}'ArgumentPasses 'BEGIN{IGNORECASE=1} /^HTTP\// || /^location:/ {gsub("\r",""); print}' to awk.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
curl -sS -I -L http://example.com | awk 'BEGIN{IGNORECASE=1} /^HTTP\// || /^location:/ {gsub("\r",""); print}'
Example output
HTTP/1.1 301 Moved Permanently
Location: https://example.com/
HTTP/2 200
Illustrative output — exact values vary by system and data.
Official sources