Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Finding the Public IP address in a shell script

For use in scripting, it would be handy to be able to do this:

IP=`....something ....`
echo ...$IP... >> configfile

I'm looking for the IP address as seen by the web, in this instance. Ubuntu, if it makes a difference. Happy to install a package or two.

share|improve this question

marked as duplicate by Michael Hampton, EEAA, mdpc, Zoredache, kce Feb 5 '13 at 3:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Thanks - I looked for dupes but didn't find. – Steve Bennett Feb 5 '13 at 22:47
up vote 3 down vote accepted

[stephan@nemesis] ~ $ curl

Voila. :)

share|improve this answer
I'd suggest, returns (to curl) only the IP address without any header or body tags. – Stephan Feb 5 '13 at 2:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.