curl -s -I $url | grep \^Location: | cut -d ':' -f 2-
# I had a longer version that continued following redirects up to a limit, but
# can't find it atm
# if you'd like to do the above anonymously, you can use https://hurl.it and
# change the HTTP method from GET to HEAD and paste in your URL (assuming HEAD
# is supported by the webserver). In the response you'll see the
# Location: HTTP header w/the redirected URL (assuming nominal situation).