Last Updated: June 28, 2020
· malte70

Decrypt shortened URL, the minimal way

Sometimes, you want to see which URL is behind a shortened link, without visiting the site.

If so, you might simply use a HEAD request with curl ( is the example URL):

$ curl -s -I | grep '^Location' | cut -d" " -f2

Or, using awk instead of grep and cut:

$ curl -s -I | awk '/^Location/ { print $2 }'

1 Response
Add your response

Leverage your curl-fu better!

curl -sIw '%{redirect_url}\n' | tail -1


over 1 year ago ·