# local ip adress



## ogg (Dec 23, 2002)

hello folks,

who knows a different command to show the local ip-adress on en0? i alwalys use "ifconfig", but i get so much informations i dont need...


----------



## ksv (Dec 23, 2002)

Uhm, at least 'ifconfig en0 inet' is one step closer


----------



## gatorparrots (Dec 23, 2002)

*How to get your local IP address*
ifconfig en0 inet | grep 'inet ' | awk ' { print $2 } '


----------



## btoneill (Dec 23, 2002)

```
arp `hostname`
[\code]

Hah, beat that for simplicity :)

Brian
```


----------



## gatorparrots (Dec 23, 2002)

ipconfig getifaddr en0
No backticks or errors required. 

If you need to get your en0 address frequently (i.e. because you are in a DHCP situation), this is the command I would alias in my ~/.*shrc file.
alias 'ipconfig getifaddr en0'


----------



## Arty (Dec 24, 2002)

This works fine on my Mac:

ifconfig -a | grep inet | grep "netmask" | grep -v "127.0.0.1" | awk '{print $2}'

Arthur


----------

