Posted By

berkes on 02/04/10


Tagged

ip sed wget networking public


Versions (?)

Commandline oneliner to get your public IP adress


 / 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?

  1. wget --quit -O - checkip.dyndns.org | sed -e 's/[^:]*: //' -e 's/<.*$//'

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: zzeroo on May 4, 2011

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

You need to login to post a comment.