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

Out­put

inet [ip address] netmask 0xfffff000 broadcast 11.115.16.255

Ryan Sukale

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

You may also like...