From f997f53c3c709739e54b74c806522ac363d33d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vivek=20=C3=97=CD=9C=C3=97?= Date: Mon, 22 Jul 2024 09:45:00 +0100 Subject: [PATCH] Using `curl` to retrieve your external IP address --- bash.html.markdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bash.html.markdown b/bash.html.markdown index e0e4f88a..5c88beaf 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -519,4 +519,22 @@ info bash info bash 'Bash Features' info bash 6 info --apropos bash + +# Using `curl` to retrieve your external IP address +# `ifconfig.me` or `checkip.amazonaws.com` is a service that returns your public IP address. +curl ifconfig.me +# => 123.123.123.123(example) +# Fetching detailed information about your IP address +curl ipinfo.io +# => { +# "ip": "123.123.123.123", +# "city": "City", +# "region": "Region", +# "country": "Country", +# "loc": "12.3456,78.9012", +# "org": "Organization", +# "postal": "12345", +# "timezone": "Region/City", +# "readme": "https://ipinfo.io/missingauth" +# } ```