Если вы добавите -i к своей команде, вы получите заголовки HTTP в выводе, а "Location:" во 2-й строке будет тем, что вы хотите.
Например, эта команда:
curl -i -o test.html http://google.com
Создает этот вывод в файле:
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Wed, 07 Mar 2012 21:00:39 GMT
Expires: Fri, 06 Apr 2012 21:00:39 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>