2008-08-29 19:27:57

What's my public IP?

Here are 2 ways, to determine your public IP address using curl, sed and grep. I recommend using the second one.

curl -s www.wieistmeineip.de | grep class=\"ip\" | sed -r 's#(.*>)(.*)(<.*)#\2#'
curl -s checkip.dyndns.org | sed -r 's#(.*: )([0-9.]*)(<.*)#\2#'


Posted by haui | Permanent Link | Categories: linux