How to get the ip address of your localhost on a mac

If you need to use the ip address of your mac instead of using local­host, here is an easy way to find the ip address of your mac via the com­mand line.

Just run the fol­low­ing com­mand in your terminal

ifconfig | grep broadcast

In the out­put that fol­lows, the place that I have marked as [ip address] is your local ip address


inet [ip address] netmask 0xfffff000 broadcast

Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...