Skip to content

Instantly share code, notes, and snippets.

@foo4u
Created October 14, 2013 17:40
Show Gist options
  • Save foo4u/6979226 to your computer and use it in GitHub Desktop.
Save foo4u/6979226 to your computer and use it in GitHub Desktop.
Simple bash function using wget to print out headers (just add to .bashrc)
function headers {
wget -O /dev/null -S -q $1
}
@foo4u
Copy link
Author

foo4u commented Oct 14, 2013

Sample usage:

$ headers http://www.google.com
  HTTP/1.1 200 OK
  Date: Mon, 14 Oct 2013 17:41:34 GMT
  Expires: -1
  Cache-Control: private, max-age=0
  Content-Type: text/html; charset=ISO-8859-1
  Set-Cookie: PREF=ID=50db7e8338633258:FF=0:TM=1381772494:LM=1381772494:S=Vkn4x_cWfQxHbbMw; expires=Wed, 14-Oct-2015 17:41:34 GMT; path=/; domain=.google.com
  Set-Cookie: NID=67=BJWWfIb7UjEVdty29jeMvCl6iQeeqeTN5M7Z9KQMIvQpzS_oyuIqHaXbCaadj7wgoqPNsTCBKuTduKVFm2SvARNPQnRPP1QygD3ISmLMO2AfHa0ZX9nwkNKlqmnLdnUD; expires=Tue, 15-Apr-2014 17:41:34 GMT; path=/; domain=.google.com; HttpOnly
  P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
  Server: gws
  X-XSS-Protection: 1; mode=block
  X-Frame-Options: SAMEORIGIN
  Alternate-Protocol: 80:quic
  Transfer-Encoding: chunked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment