To check your public ip address via terminal run:

curl ifconfig.me

If you don’t have curl installed run:

sudo apt install curl && curl ifconfig.me