Skip to content

Instantly share code, notes, and snippets.

@notsle
Last active January 3, 2024 06:24
Show Gist options
  • Save notsle/a5561aad60ecfc272d8e to your computer and use it in GitHub Desktop.
Save notsle/a5561aad60ecfc272d8e to your computer and use it in GitHub Desktop.
Get Public IP address with curl and ipchicken.com
curl -s https://ipchicken.com | egrep -o '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'
@manipulator01
Copy link

if you don't have egrep installed or don't wanna deal with grep in general, you can do this;

curl ipaddress.ai

wget can also be used;

wget -qO- ipaddress.ai

or visit ipaddress.ai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment