How can I find my public IP using the terminal

wget http://ipecho.net/plain -O - -q ; echo

or

curl http://ifconfig.io