Created
December 18, 2012 03:53
-
-
Save liudangyi/4324850 to your computer and use it in GitHub Desktop.
Get the IPv4 address of eth0 in shell
This file contains 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
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