/ Published in: Bash
URL: http://www.go2linux.org/what-is-my-public-ip-address-with-linux
Use wget and sed to get your public IP adress (instead of firing up firefox and visting whatismyip.com). Usefull in scripts where you need your public IP adres.
There are probably better ways, maybe even a GNUtool that I missed?
Expand |
Embed | Plain Text
wget --quit -O - checkip.dyndns.org | sed -e 's/[^:]*: //' -e 's/<.*$//'
Comments
Subscribe to comments
You need to login to post a comment.

There is a spelling error. The wget parameter is --quiet not --quit wget --quiet -O - checkip.dyndns.org | sed -e 's/[^:]*: //' -e 's/