how to get public ip address on mac using terminal code example Example: get ip mac terminal ipconfig getifaddr en0