how to get ip address in terminal mac code example
Example 1: find my ip mac terminal
ipconfig getifaddr en0
Example 2: get ip of mac
Use for wireless
ipconfig getifaddr en1
or for ethernet
ipconfig getifaddr en0
ipconfig getifaddr en0 is default for wifi interface.
Example 3: get your ip address from terminal
for local ip :
hostname -I
for Public ip :
curl icanhazip.com