Skip to content

Instantly share code, notes, and snippets.

@wmeints
Created January 28, 2015 08:12
Show Gist options
  • Save wmeints/0a6b3223acb2c9f45c18 to your computer and use it in GitHub Desktop.
Save wmeints/0a6b3223acb2c9f45c18 to your computer and use it in GitHub Desktop.
Grab first IP-address of your linux machine
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