Last active
December 27, 2017 09:14
-
-
Save samundra/2f7319f802ffff6189da2682e8615533 to your computer and use it in GitHub Desktop.
Show Local IP
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
findIp() { | |
ip=`ifconfig -a | grep inet|grep "192."|tail -1|cut -f2 -d ":"|cut -f1 -d " "` | |
echo $ip | |
} | |
findIp | |
# Usage: | |
# chmod +x show-ip.sh | |
# - ./show-ip.sh | |
# $ sudo ln -sf /usr/local/bin/show-ip $(pwd)/show-ip.sh | |
# Then can be used as `show-ip` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment