Author: Aaron White, Date: 23rd November 2014

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:
cd ~
mkdir bin
nano bin/whatismyip.sh

Step 2. Edit in Nano:

#!/bin/bash
wget www.whatismyip.com/automation/n09230945.asp -O – -q
echo
Press Ctrl + O, Enter, Ctrl + X

Step 3. Set Rights:
chmod u+x bin/whatismyip.sh

Step 4. Run Script:
~/bin/whatismyip.sh

Step 5. Celebrate!
Brag to your friends that you know what the public IP your Linux box is using.

eSOZO > Blog > WAN IP in LINUX SHELL

eSOZO Computer and Network Services

200 Route 31
Suite 202
Flemington NJ, 08822 Phone: (888) 376-9648 Email: info@esozo.com

MANAGED & HOSTED IT SERVICES FOR BUSINESS

Our Services
Real Time Analytics