Skip to content

Get IP Addresses with ifconfig command

Share Button

Max OS X

ifconfig en0 | grep -i inet | awk '{print $2}' | cut -f 2 -d ':'

Result

178.62.55.250

 

RedHat

ifconfig eth0 | grep -i inet | awk '{print $2}' | cut -f 2 -d ':'

Result

178.62.55.250

Share Button