Skip to content

Instantly share code, notes, and snippets.

@liudangyi
Created December 18, 2012 03:53
Show Gist options
  • Save liudangyi/4324850 to your computer and use it in GitHub Desktop.
Save liudangyi/4324850 to your computer and use it in GitHub Desktop.
Get the IPv4 address of eth0 in shell
ifconfig eth0 | grep inet | grep -v inet6 | awk '{print $2}' | sed 's/.*://g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment