How to get public IP from shell

curl https://ipinfo.io/ip