One-liner of the day: Get your primary IP address

Get the IP adress of the interface where the default route is

ifconfig $( ip route | grep ^default | awk '{ print $NF }' ) | grep "inet " | awk '{ print $2 }'
Advertisements