01/03/14 19:30:13

Get Every Redirect of a Short URL

Apparently I never published this here. Some time ago I wanted to see where a short URL takes me. I needed this for Twitter because when you copy a link, even though it says the original URL, Twitter’s own shortner t.co is copied.

The solution is actually quite simple:

curl -sIL http://t.co/9acY1bnnFg | grep ^[lL]ocation

This short command will show every redirect this URL takes:

location: http://tmblr.co/ZFavEy139CkNk
Location: http://www.tumblr.com/ZFavEy139CkNk
Location: http://mosx.tumblr.com/post/72095032814/an-official-statement-on-the-future-of-mac-os-x#_=_