Finding out public IP from console on Linux

My site of choice to lookup my public IP is This is very easy to use from a browser but not as straight forward if you only have access to the console. The trick is to use wget and a regular expression to extrac the IP address.

The script below is taken fromĀ wolfvorkian1 atĀ

wget -qO - | egrep -m1 -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'

This will just display your external public IP