How to get IP Address in Linux using Command terminal

To connect some local running server application via browser, access FTP server, and many other times we require to know our system Ip address. Thus, if you are running some Linux operating system then here is the way to check out your current IP Address using the command terminal.

I am going to show the two most common ways to find out IP of Linux PC or Server running systems:

The first method is to get an IP address in Linux is using inbuilt command i.e ip addr

  • Open Linux command terminal
  • Runip address to get the IP address
  • It doesn’t matter are you on Ubuntu, CentOS, Manjaro, Debian Linux mint, etc. The above command will work on all of them.

You will not only have an Internet protocol address but also its ethernet interface. This command is not just limited to that only, we can use its help section to know all the available flags.

ip address help

Get Linux ip address using command

 

The second way is using the most common net-tools. However, by default, it will not be on your system and the user has to install it using a command.

  • On Ubuntu/Debian Linux- sudo ap install net-tools
  • For RHEL/CentOS/Fedora- sudo yum install net-tools or sudo dnf install net-tools
  • In Manjaro/Arch Linux- sudo pacman -Sy net-tools

 

Usage to get Linux system’s Ip address using Net-tools:

ifconfig

Ifconfig command for network Linux IP address

To know more about the network, we can use the help section of ifconfig. Where we will find the various flags to use with this command to find out various other addresses, such as tunnels, netmask, broadcast, and others.

ifconfig --help

Help section of Ifconfig

If you want to explore more, then see Linux System info commands using the terminal to learn how to get the complete hardware and software information such as CPU, Memory, OS version, Kernel, Network & PC card details, and more…

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.