Created
January 28, 2015 08:12
-
-
Save wmeints/0a6b3223acb2c9f45c18 to your computer and use it in GitHub Desktop.
Grab first IP-address of your linux machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PUBLIC_IP=$(ip addr show eth0 | grep "inet" | awk 'NR == 1 { print $2 }' | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment