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 -|sed -e 's/.*Current IP Address: //' -e 's/<.*$/

Using curl

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

curl -s

Using Lynx

lynx -dump

lynx -dump | 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.