There is no built in command to find your public IP from the linux shell. However, there is a very easy way to create and run a script that will display the IP for you.
Step 1. Create the script:
Step 2. Edit in Nano:
wget www.whatismyip.com/automation/n09230945.asp -O – -q
Press Ctrl + O, Enter, Ctrl + X
Step 3. Set Rights:
chmod u+x bin/whatismyip.sh
Step 4. Run Script:
Step 5. Celebrate!
Brag to your friends that you know what the public IP your Linux box is using.
Author: Aaron White, Date: 23rd November 2014