Created
February 26, 2016 05:31
-
-
Save mosuka/a769b1da3cf89d4dbfa8 to your computer and use it in GitHub Desktop.
Extract IP address from ifconfig command.
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 -a | grep -e "inet[^6]" |\ | |
sed -e "s/.*inet[^6][^0-9]*\([0-9.]*\)[^0-9]*.*/\1/" |\ | |
grep -v "^127\." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment