RSS

Unshortening with cURL

Unshortening with cURL

Sometimes you get a short URL for something and would like to know where it goes before clicking on it. cURL can help you determine this. This can be done with the following one-liner.

curl -s -o /dev/null -I -w "%{url_effective}\n" -L $URL

This can be adapted into a simple, small shell script which gives the user a usage/help when 1 argument isn’t given.