How to Find Your IP Address in Linux centos Debian linux ubuntu

Many times it happens that you feel the need of knowing the IP address of your device. Internet Protocol address or IP address is a set of numeric digits that are needed to identify your device and enable network communication because all the devices that are connected through a network know each other only through their IP addresses. Moreover, the IP address also specifies the location of a device. So it becomes necessary for you at times to know what is the IP address of whichever device you are using. Now how to find this IP address is the real question. In the article below, we will tell you all the ways through which you can find the IP address of your device while working in Linux environment, in our case Ubuntu 20.04. The same commands will work on the new Ubuntu 22.04 version too.

Four ways to find your current IP Address in Linux

Following are the four methods through which you can find the IP address of your device:

Method # 1: On the Desktop

The first method of finding the IP address of your device is through the Linux desktop interface. For this, you need to proceed as follows:

Click on your network connection icon (Wi-Fi icon) shown at the top right of the title bar on which Ubuntu Desktop is written. A cascading menu will appear which is shown below:

From the menu shown above, click on Connection Information. A new Connection Information window will appear which is shown below:

<img alt="Network connection Details" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-116.png624e985915de7.jpg" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="515" loading="lazy" src="data:image/svg xml,” width=”387″>

In the window shown above, the red highlighted rectangle shows the IP address of your device written in front of IP Address field.

Method #2: On the Shell with ip command

The second method of finding the IP address of your device is through a terminal command. In order to do this, you need to perform the following steps:

First of all, open terminal by pressing Ctrl T or you can click on the terminal icon directly if it is shown on your task bar. You can also click on the search icon located on the taskbar and then type Terminal and press enter to open it. The newly opened terminal window is shown below:

<img alt="Open the Linux Terminal" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-117.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

Type the command ip addr show in the terminal and press enter.

ip addr show

This command is shown below:Advertisement

<img alt="Show IP address" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-118.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

As soon as you will press enter, some information will be displayed on the terminal window. From the information shown below in the terminal screen, the highlighted rectangle shows the IP address of your device beside the inet field.

<img alt="Ip address shown beside the inet fiel in ip addr show command output." data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-119-1024×576.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="422" loading="lazy" src="data:image/svg xml,” width=”750″>

Method # 3: On the Shell with ifconfig command

The third method of finding the IP address of your device is through another terminal command. For this you need to follow the steps mentioned below:

Launch the terminal by pressing Ctrl T or clicking on the terminal icon or searching for terminal in the search window shown below and pressing enter.

Then type the command:

/sbin/ifconfig

in the newly opened terminal window and press enter.

<img alt="Run ifconfig command" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-120.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

As soon as you will press enter, a lot of information will be displayed on the terminal screen. From the displayed information below, the highlighted rectangle shows the IP address of your device besides the field of inet addr.

<img alt="Ifconfig command result" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-121.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

The ifconfig command works in the same way for finding the IP address of a device using terminal in Linux as ipconfig command works for finding the IP address of a device using command prompt in Windows.

Method # 4: On the Shell by using the hostname command

The method four for finding the IP address of your device makes use of yet another terminal command. For this method, you need to follow the following steps:

Launch terminal by pressing Ctrl T or clicking on the terminal icon located on the taskbar or search for terminal in the search window and press enter.

When the terminal window will appear, type the command:

hostname -I

and press enter. This command is shown in the following window:

<img alt="Run hostname -I command" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-122.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

As soon as you will press enter, the IP address of your device will be displayed on the terminal right below your entered command. This is shown below:

<img alt="Hostna,e -I command returns the current IP address of the Linux system" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-123.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="462" loading="lazy" src="data:image/svg xml,” width=”722″>

Conclusion

By making use of any of the methods listed above, you can find the IP address of your device very easily and enable a very safe and secure network communication through it. IP address gives an identity to your device so that you can recognize it whenever you want to. Once you know the IP address of your device, you are free to interact with any other device that is connected to the same network to which you are connected. I hope that this article will help you a lot in future.