The quickest way to get your public IP address from a terminal is curl https://ipcomet.com . It prints your address and nothing else, so the output can go straight into a script. This guide shows the same one-liner on macOS, Linux and Windows, how to do it from Python and Node.js, how to get your location and ISP as JSON, and how to choose between IPv4 and IPv6. The one-line answer curl https://ipcomet.com The output is a single line such as 203.0.113.7 . The hom...