Get public IP in terminal – Linux

To get the public ip type in linux terminal:

For IPV4

curl -4 icanhazip.com

For IPV6

curl -6 icanhazip.com

 

Other site to CURL in terminal public IP:

ipinfo.io/ip

ident.me

api.ipify.org

checkip.dyndns.org