Saturday, February 21, 2009

Get Public IP from Linux command

Just copy paste following command and hit enter:-




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



Result:-




harith@cengkeh:~$ wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
124.13.233.xxx
harith@cengkeh:~$



Other option is using curl :-




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



if you dont have curl, download by using following command:-




sudo apt-get install curl






0 comments: