local ip adress

ogg

Registered
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...
 
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'
 
This works fine on my Mac:

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

Arthur
 
Back
Top