Skip to main content
Haui's Bytes
  • Source
  • Archive
  • Tags
  • RSS feed
  • Disclaimer

What's my public IP?

Haui

2008-08-29 12:00

Source

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#'
  • linux
  • Previous post
  • Next post
Contents © 2019 Haui - Powered by Nikola