Thursday, July 8, 2010

Linux command: What is my IP? (Public IP address)

SkyHi @ Thursday, July 08, 2010
Lots of times you need to determine your public IP address, if you are using Linux operating system to power your PC, you may use some good console commands to guess your public IP address.

Using wget

wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$/

Using curl

curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

curl -s http://whatismyip.org/

Using Lynx

lynx -dump checkip.dyndns.org

lynx -dump www.whatismyip.com | grep 'Your IP'

As you can see, there are a lot of ways to check your Public IP address using console commands in Linux.

Of course you can always open a browser and enter any of those URIs and check there.


REFERENCES
http://www.go2linux.org/what-is-my-public-ip-address-with-linux