How to get external IPv4 address using curl

Run the following command to print your external IP address:

get_external_ipv4.sh
curl -fsSL https://api4.ipify.org

Example output:

output.txt
80.187.71.195

 


Check out similar posts by category: Networking