BGP.guru

BGP.guru

Nerd blog.

12 Aug 2014

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.


Theodore Baschak - Theo is a network engineer with experience operating core internet technologies like HTTP, HTTPS and DNS. He has extensive experience running service provider networks with OSPF, MPLS, and BGP.