Created
April 28, 2015 21:40
-
-
Save ryanmoon/36e878e0764c234cd879 to your computer and use it in GitHub Desktop.
Print First Octet of IP Address (OS X)
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
ipconfig getifaddr en0 | tr "." " " | awk '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where en0 is the IP address you want.