Get public IP from bash

In case anyone finds this useful, sometimes I need to get my public IP from bash or scripts and I use, only because it's easy to remember.

But more and more often lately, some IPs are blocked there and get http errors, so I bought a cheap domain and I woke up a $3/year @natvps_uk from idling, and..

wget -4 -qO-
or for ipv6
wget -6 -qO-

(or curl -4L if curl is your thing)



Sign In or Register to comment.