PDF download Download Article
Easy steps to find your public or private IP address in seconds
PDF download Download Article

You can view your IP address in Linux using simple terminal commands or in the GUI. The steps will vary a bit depending on whether you want to find your public IP address (the one that identifies you on the internet) or your public IP address (the one that identifies you on a local network). This wikiHow guide will teach you multiple ways to check your IP address in any version of Linux, including Ubuntu, Arch Linux, Kali Linux, and any other distro.

Quick Commands to Check Your IP Address in Linux

  • Your public IP address identifies you on the internet, while your private IP address is only visible on your local network.
  • To see your public IP address, use the command curl ifconfig.me or wget -qO- ifconfig.me | grep ip_addr.
  • To see your private IP address, use the command ip addr, hostname -i, or ifconfig.
Section 1 of 3:

Commands to Show Your Public IP Address

PDF download Download Article
  1. This command gets your public IP address from the remote website ifconfig.me and prints it on the screen.[1]
    • The public IP address is what websites and services see when you access them over the internet. If you want to try to connect to your computer via a remote connection that isn't on the same network, you'll need the public IP address.
    • If the website (ifconfig.me) isn't responding, try these commands instead:
      • curl icanhazip.com
      • curl checkip.amazonaws.com
  2. If you can't use the curl command, you can use wget to get your IP address from the same website. You'll find your IP address next to "ip_addr" in the output.
    • If the website isn't working, try these commands instead:
      • wget -qO- icanhazip.com
      • wget -qO- checkip.amazonaws.com
  3. Advertisement
Section 2 of 3:

Commands to Show Your Private IP Address

PDF download Download Article
  1. If you're trying to find the IP address of your computer within your local network–for example, if you're setting up port forwarding on a router or need to allow your computer through a firewall–you'll need to know your computer's private IP address. Running the command ip addr in a Terminal window displays your private IP address for all active interfaces (e.g., Wi-Fi, Ethernet).[2]
    • For example, if you want to find the IP address of your Ethernet connection, look for the IP address next to "inet" for "eth0."
    • This command will display both IPv4 and IPv6 IP addresses, as well as MAC addresses.
    • You can also use the command ip a as a shortcut.
  2. This command also displays your private IP address, but with no other information.[3]
    • You can also run the command hostname (without the -i option) to display just the hostname of your Linux computer.
  3. While this command is deprecated on many versions of Linux, you can use ifconfig to display your private IP address if you have the net-tools package installed.
  4. If your Linux distribution has the network-manager package installed, you can run this command to display your private IP address, default gateway, MAC address, and other details.
  5. Advertisement
Section 3 of 3:

GUI Ways to Show Your IP Address

PDF download Download Article
  1. You can find your public IP address in your preferred web browser in any Linux GUI. To do so, just visit any of these websites:
  2. The steps to check your private IP in your Linux desktop environment vary by interface, but they're all simple:
    • If you're using the GNOME or KDE desktop environment, open your Settings, click Network in the sidebar, and click the gear icon next to the connection to find your IP address.[4]
    • If you're using Cinnamon, click the network icon in the system tray and select the network interface to display your IP address.[5]
    • In XFCE, right-click the network icon in the system tray and select Connection information to display your private IP address.[6]
  3. Advertisement

Community Q&A

Search
Add New Question
  • Question
    What is an IP address?
    Pingu
    Pingu
    Top Answerer
    It is a label that consists of four numbers separated by dots. Every computer with an internet connection is assigned an IP address. It is used so that computers can connect to each other. If you write the name of a web page into your browser's address bar, it actually looks up what IP that name refers to and then connects with that IP.
  • Question
    How can I find someone else's IP address using my own device?
    Pingu
    Pingu
    Top Answerer
    If the device the IP of which you're trying to find has a domain name, you can use the "nslookup" function. So for example, "nslookup google.com" would give you the IP address of one of Google's servers. If it doesn't, and the device connected to your device at some time, one of the many logs (located at /var/log) can contain its IP address. Other than that, there is no way to find someone else's IP address from your device, but you can use theirs.
  • Question
    What would I enter at the command prompt (terminal) on a Linux system to display a list of files and sub directories that exist within the present working directory?
    Somone
    Somone
    Community Answer
    You can type "ls" (without quotes) to list the files and directories in the present working directory and "ls -a" to list everything, including all hidden files.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Assign an IP Address on a Linux ComputerAssign an IP Address on a Linux Computer
Ping an IP Address Ping an IP Address + Troubleshooting & FAQ
Find Out Your IP Address6 Easy Ways to See Your IP Address on PC, Mac, Android & iOS
Find the IP Address of Your PC Find Your IP Address on a PC: Windows & Linux
Check a Computer IP Address Find the IP Address of Your Computer, Phone, or Tablet
Find an IP Address Find the Public or Private IP Address on Any Device
Find Your IP Address on a Mac Find Your Internal & External IP Address on a Mac
Find Your Router's IP Address Find Your Router's IP Address: Mobile, PC, Mac, Chromebook, & Linux
Find a Website's IP Address Find a Website's IP Address Fast (According to a Tech Expert)
Trace an IP AddressEasy Ways to Track any IP address on the Internet
Acquire a New IP AddressA Step-By-Step Guide to Aquire a New IP Address
Change Your IP Address (Windows)Change Your IP Address (Windows)
Find Your Printer IP Address Find Your Printer's IP Address
Configure a Static Internet Protocol (IP) Address on a Computer Configure a Static Internet Protocol (IP) Address on a Computer
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 24,151,442 times.
How helpful is this?
Co-authors: 17
Updated: March 10, 2026
Views: 24,151,442
Categories: Linux
Article SummaryX

To check your public IP address in Linux, start by clicking the Terminal app icon or simultaneously pressing “Control,” “Alt,’ and “T” to bring up the Terminal window. Once the Terminal window is open, enter the public IP command "curl ifconfig.me" to retrieve your address from a website. Press “Enter” to run the command, and wait for your public IP address to appear. Alternatively, to find your private IP address, bring up the terminal window and enter the Show IP command "ifconfig." Press Enter to run your command and display the IP address information of any network items, including your computer. In order to find your computer’s heading, look under the “wlo1” heading and review the private IP address. To learn how to use the “hostname” command to bring up your computer’s IP address, keep reading!

Did this summary help you?

Thanks to all authors for creating a page that has been read 24,151,442 times.

Reader Success Stories

  • Roland Weber

    Roland Weber

    Sep 6, 2016

    "It's great to have several different terminal commands to choose from. I used to call ifconfig, but that..." more
Share your story

Is this article up to date?

Advertisement