productivity tip

Find the actual URL from shortened URL

When on the internet we come across a shortened URL multiple times. Those URL mostly. We cannot really know what is behind that masked URL unless we click it. But there is a trick to unmask the URL right from your terminal.

curl -kIs -w "%{redirect_url}\n" -o /dev/null  <url_here>Code language: JavaScript (javascript)

Replace the <url_here> portion with your shortened URL. This requires you to be connected to internet. Simple explanation about how this works is. curl follows the redirects right from terminal until it gets 200 OK. You have to understand HTTP protocol to grasp a understanding on HTTP Status codes.