WAN IP in LINUX SHELL

Posted by on | |
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.

1 comments:

Unknown said...

I thought that I would be able to figure out how to use this but I was wrong. I like to think that I am good with computers. I guess I really am not, I didn't understand anything here.

Alena | http://www.portlandcomputercopy.com/home/it-services/

Post a Comment