1. -s: Silent mode to suppress unnecessary output.
2. -I: Fetches only the HTTP headers.
3. awk 'NR==1 {print $3}': Extracts the third field from the first line of the response headers, which is the status message
1. -s: Silent mode to suppress unnecessary output.
2. -I: Fetches only the HTTP headers.
3. awk 'NR==1 {print $3}': Extracts the third field from the first line of the response headers, which is the status message
curl -s -I <URL> | awk 'NR==1 {print $2, $3}'
curl -s -I <URL> | awk 'NR==1 {print $2, $3}'
-o /dev/null: Discards the response body.
-w "%{http_code}\n": Writes the HTTP status code.
-o /dev/null: Discards the response body.
-w "%{http_code}\n": Writes the HTTP status code.