Commandline oneliner to get your public IP adress


/ Published in: Bash
Save to your folder(s)

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?


Copy this code and paste it in your HTML
  1. wget --quit -O - checkip.dyndns.org | sed -e 's/[^:]*: //' -e 's/<.*$//'

URL: http://www.go2linux.org/what-is-my-public-ip-address-with-linux

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.