ifconfig | grep "inet "
ifconfig en0
ipconfig getifaddr
ipconfig getifaddr en0
Use for wireless
ipconfig getifaddr en1
or for ethernet
ipconfig getifaddr en0
ipconfig getifaddr en0 is default for wifi interface.
To find your IP address on a Mac, go to
System Preferences > Network
and select your connection in the left sidebar.
Then click Advanced > TCP/IP and you will see
your computer's IP address next to IPv4 Address
and your router's IP address next to Router.