cmp.is

How to get your local ip in OS X from terminal

0 Comments

I recently needed to get my local IP from the terminal in OSX and I found a crazy way to do that from this StackOverflow question

ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'

It does work even though I don’t really want to spend the brain power needed to understand it enough to explain it.


Any issues or suggestions? Tell me on github.

0 Comments