How to Get Public External IP From Command Line Terminal - Linux

Printer-friendly versionPDF version
Linux Public IP

If you are trying to find out what your public external IP address is, you typically go to a web site specifically for this purpose, such as or Thanks to cURL, you can easily do this from the command line too. To install cURL, run the following command:

  • Ubuntu: sudo apt-get install curl
  • openSUSE: sudo zypper install curl

To find out what public IP you are using, run this command:


A single line will be returned containing your public external IP address.


You can get the same results using wget:

wget -qO-

the site is down.

"curl" will also work (and seems to have a faster response at least from my location)

Here's one that works a bit faster: wget -qO-

Thanks a lot!

If you install cURL or wget on Windows, you can use these same commands to find your external IP in Windows also. 

You Rock!

Thanks for sharing the information ingram.I use for IP and Host Search.

Post new comment