Published: July 22, 2026
Read: 8 min
In: Technology & Development

Written by

Reviewed by

Last updated: June 25, 2023

Expert verified

SVG Image

TL;DR

To learn to find IP address in Linux, try these five methods:

  1. Use the command ifconfig in the Terminal to find the IP address assigned to a specific network interface.
  2. Retrieve IP addresses using the ip addr show command in the Terminal, locating the desired network interface in the output.
  3. Obtain the IP address of your system by executing the command hostname -I in the Terminal.
  4. Retrieve IP addresses using the nmcli device show command in the Terminal, locating the desired network interface in the output.
  5. Find IP addresses with the ss -ltn command in the Terminal, looking for the desired listening socket in the output.

Troubleshooting common issues when finding IP addresses in Linux involves validating network configurations, resolving connectivity or permission problems, and addressing common errors such as “No IP address found,” “Interface not found,” “Permission denied,” “Invalid command or option,” and “Network unreachable.”

Explore the article below to learn different methods to find IP address in Linux and common errors with possible solutions.

IP addresses play a vital role in Linux networking, allowing devices to communicate with each other on a network. Knowing how to find IP address in the command line is essential for system administrators and network enthusiasts. In this comprehensive guide, I will explore different methods to retrieve IP addresses using various command-line tools in Linux. I will also discuss some of the common errors with possible solutions.

How to Find IP Address in Linux

To find IP address in Linux, you can use the following commands: ifconfig to find IP addresses assigned to network interfaces, ip to retrieve advanced network information, hostname -I to get the system’s IP address, nmcli for network connection management, and ss to obtain socket-related details.

1. ifconfig Command

The ifconfig command is a widely used networking tool in Linux that provides detailed information about network interfaces. It lets you find the IP address assigned to a specific network interface. Here are the steps to follow:

  1. Open the Terminal.
opening terminal 7
  1. Enter the following command: 

<strong>ifconfig</strong>
  1. Locate the network interface you are interested in (e.g., eth0, wlan0). Look for the inet or inet addr section under the respective interface.
getting IP address using ifconfig in linux

2. ip Command

The ip command is a powerful and versatile networking tool in Linux. It provides advanced capabilities for managing network interfaces and retrieving IP addresses. Follow these steps to find ip address in Linux using ip command:

  1. Launch the Terminal window and type the following command: 

<strong>ip addr show</strong>
  1. Look for the inet or inet6 section under the respective interface.
displaying IP address using IP command

3. hostname Command

The hostname command provides information about the system’s hostname and related network configurations, including the IP address. It uses hostname resolution mechanisms like DNS or /etc/hosts file to map the hostname to its IP address. Follow these steps:

  1. Access the command line and execute the following command: 

<strong>hostname -I</strong>
  1. The IP address displayed represents the assigned IP address of your system.
showing ip address using hostname command

4. nmcli Command

The nmcli command provides a command-line interface for NetworkManager, a popular network management tool in Linux. It offers powerful capabilities for managing network connections, including retrieving IP addresses. Here are the steps to do it:

  1. Launch the command window and enter the following command: 

<strong>nmcli device show</strong>
  1. Look for the IP4.ADDRESS or IP6.ADDRESS section under the respective interface.
showing ip using nmcli command

5. ss Command

The ss command is a versatile tool for socket-related information in Linux. It allows you to retrieve IP addresses, among other network details. The ss command provides various options and filters to narrow down the output and obtain specific information about network connections and sockets. Here are the steps to do it:

Instructions for finding IP addresses using the ss command

  1. Access the Terminal and Type the following command: