How to View IP Address on Linux

There are several ways to view your system’s IP address in Linux. In this tutorial, you will learn how to see your IP address from command line and GUI.

In case you want to check your system’s external IP address instead: Check External IP From Linux Command Line

Commands to View Internal IP Address

Method 1. Using the ip command will show the IP address of all your network interfaces:

$ ip address

Or to shorten the command:

$ ip a

We have highlighted the IPv4 and IPv6 addresses in the output below:

Terminal output from the ip command

Method 2. Using the hostname command:

$ hostname -I | awk '{print $1}'

Method 3. Using the ip route command will show you the IP address of the interface that is used for routing to an IP that you specify – in this case,

$ ip route get | awk '{print $7}'

Method 4. For Linux systems that have Network Manager installed, you can use the nmcli command:

$ nmcli -p device show

Output of nmcli command

Viewing Internal IP via GUI

You can also view your IP address by using the GUI in your system. Here are the instructions for GNOME:

Step 1. In your desktop, locate and open the network icon in the top right of your screen. Then click on Wired or Wireless Settings.

Opening the network settings in GNOME

Step 2. In the Network tab, click on the gear icon to show all the details for that network interface.

Cogwheel icon for network settings

Step 3. This window will reveal your IPv4 and IPv6 address.

Viewing IPv4 and IPv6 address in GNOME settings

Leave a Comment

Your email address will not be published. Required fields are marked *