Skip to content

Instantly share code, notes, and snippets.

@hotienvu
Last active August 29, 2015 14:04
Show Gist options
  • Save hotienvu/e5e0f37db66952dcbef4 to your computer and use it in GitHub Desktop.
Save hotienvu/e5e0f37db66952dcbef4 to your computer and use it in GitHub Desktop.
Get Ip address and hostname of the current host
echo "$(ifconfig eth0|grep "inet add"|awk -F\: '{print $2}'|awk '{print $1}')" "$(hostname)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment