See Headers Only From Command Line CURL

To See headers only and not the HTML response from a web server, you can use the command line CURL program to do it.

curl -I -L 'http://google.com';

Output

HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Fri, 01 Sep 2017 19:28:09 GMT
Expires: Sun, 01 Oct 2017 19:28:09 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

HTTP/1.1 200 OK
Date: Fri, 01 Sep 2017 19:28:09 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID=111=G42bDboDRldDu_KQqjkSU9XqY-WFRlE5JJ3JJp-LhKgF4kkONHaf7Fbzp_Qdo_cfsy-ch2sl7qt0uDZAnDTXKNw3P4BsyusiVxL0ZddVqU8MpkeOc-bZfJXEdb4Bdpxp; expires=Sat, 03-Mar-2018 19:28:09 GMT; path=/; domain=.google.com; HttpOnly
Transfer-Encoding: chunked
Accept-Ranges: none
Vary: Accept-Encoding

Leave a Reply

Your email address will not be published. Required fields are marked *