How to query the computer's ip address?

Nicholas Holley nickpub at imap.cc
Sun Feb 8 03:27:14 PST 2004


Rob wrote:
> 
> Hi,
> 
> Silly question, maybe, but is there a simple command to query the 
> computer's
> ip address? Something similar to 'hostname' for finding the computer's 
> hostname.
> I need the four dot-separated ip numbers.
> 
> I can analyze the output of 'ifconfig', but isn't there an easier way.
> 
> Thanks,
> Rob.

If reading the output of ifconfig is really too much trouble for you, 
then I would suggest writing up a small script or alias to grep the 
output of ifconfig.

Nick


More information about the freebsd-questions mailing list