-
On OSX(Mac) mac> ifconfig en0 | grep "inet " | cut -d\ -f2 On Linux linux> ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{print $2}'