Print only response headers with curl

To print only response headers with curl use following command:

$ curl -s -D – http://www.google.com -o /dev/null

Output:

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.in/?gfe_rd=cr&ei=YLBZVLDTCajV8gfJ44GwBQ
Content-Length: 261
Date: Wed, 05 Nov 2014 05:06:40 GMT
Server: GFE/2.0
Alternate-Protocol: 80:quic,p=0.01

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s