curl by default does not follow redirects (301, 302, ...)
$ curl https://www.example.com
Enabling follow redirects:
-L
Output to file instead of stdout:
-o <filename>
Adding headers to output:
-i