You are currently viewing How to Find IP Address in Linux: 7 Easy Methods for Beginners and Pros

How to Find IP Address in Linux: 7 Easy Methods for Beginners and Pros

  • Post author:
  • Post last modified:June 22, 2025

Wondering how to find IP address in Linux? It’s easier than you think. Whether you’re troubleshooting network issues or configuring a server, knowing your IP address is essential. In this guide, we’ll walk you through multiple ways to check IP address in Linux—from GUI-based tools to powerful terminal commands.

What Is an IP Address and Why Does It Matter in Linux?

An IP address is a unique identifier assigned to your device on a network. In Linux, knowing your IP can help with server setups, remote access, firewall rules, and more. Most Linux systems offer several commands to view both internal (private) and external (public) IP addresses.

How To Find IP Address in Linux Terminal?

The Linux terminal gives powerful tools to retrieve your system’s IP configuration. Here are the most common commands:

1. Using the ip Command

The modern way how to find IP address in Linux is using the ip command:

ip addr show

Example Output:

InterfaceIP Address
eth0192.168.1.104

This shows details for all available network interfaces. Look for inet followed by an IP address.

2. Using the hostname -I Command

If you just want a clean output with your internal IP address:

hostname -I

This outputs only your LAN IP address, making it great for scripting.

3. Using ifconfig (Legacy)

On older systems, you may prefer ifconfig:

ifconfig

Note: You may need to install net-tools first using:

sudo apt install net-tools

4. Using the nmcli Command

nmcli is a Network Manager command-line tool:

nmcli device show

Scroll to find IP4.ADDRESS[1].

5. Using the ip route get Command

This trick routes to an external destination to reveal the IP used:

ip route get 1.1.1.1

Look for the IP after “src”.

6. Viewing IP Address through GUI (Desktop Users)

If you’re using Ubuntu or another desktop environment:

  • Go to Settings > Network.
  • Select your connection (Wi-Fi or Ethernet).
  • Click the gear icon to view IP information.

7. Checking Your Public IP Address

Your router may assign a different public IP. Use:

curl ifconfig.me

Or:

curl ipinfo.io/ip

FAQ: Linux IP Address Commands

What is the IP command in Linux?

The ip command is the modern utility to manage networking in Linux. It replaces older tools like ifconfig. Run ip addr to show IP addresses.

How do I check the internal IP address in Linux?

Internal (local) IP addresses are obtained with commands like hostname -I, ip addr, or through your GUI network settings.

How can I find my IP address in Linux without root?

Most commands like ip addr or hostname -I don’t require root access. You’ll only need elevated permissions for network changes, not inquiring.

What’s the difference between internal and public IPs?

An internal IP is your machine’s address on LAN, usually something like 192.168.x.x. A public IP is assigned to you by your ISP and visible on the internet.

Can I find the IP with a script or automation tool?

Yes! Try adding hostname -I or ip route get 1.1.1.1 to your shell scripts to programmatically grab the IP address.

Final Thoughts on How to Find IP Address in Linux

Whether you’re managing a headless server or a Linux desktop, there are plenty of ways to check your IP address. From the powerful ip command to desktop GUI tools, Linux gives you flexibility no matter your experience level. Need quick automation? Use hostname -I. Want detailed info? Stick with ip addr. Knowing how to find IP in Linux is a foundational skill—now you’ve got 7 foolproof methods to do it right.