If you’ve ever needed to find your public IP address quickly from the command line, one handy method is using the wget
command along with a simple web request. Here’s how you can do it:
wget http://ipinfo.io/ip -qO -
What Does This Command Do?
Let’s break down the components:
wget
: A powerful command-line utility used for downloading files from the web.http://ipinfo.io/ip
: This URL returns your public IP address in plain text when accessed.-qO -
: The-q
flag makes the output “quiet,” meaning it suppresses all non-essential messages fromwget
. TheO -
flag tellswget
to send the output to the standard output (your terminal) instead of saving it to a file.