These wget recipes show you how to print the HTTP response headers that come back from the server. Wget normally hides them, but you can make them visible with the -S
flag.
Print the Headers to Stdout
wget -S https://google.com
This recipe uses the -S
flag to print the HTTP response headers to screen. The body is still saved to the default output file (usually index.html
unless -O
is used).
Print the Headers to Stdout (and Don't Save the Contents)
wget -S -q -O /dev/null https://google.com
This recipe combines -S
(show headers), -q
(quiet), and -O /dev/null
(discard body) to make wget print only the headers and nothing else.
Created by Browserling
These wget recipes were written down by me and my team at Browserling. We use recipes like this every day to get things done and improve our product. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!
Secret message: If you love my wget recipe, then I love you, too! Use coupon code WGETLING to get a discount at my company.