What is an IP Address?
A Internet Protocol address (IP address) is the numerical label assigned to each hardware devices connected to a computer network that uses the Internet Protocol to identify the devices. In general terms, it is an identity of any device. An IP address allows a device to communicate with other devices over an IP-based network like the LAN or Internet.
Read: 5 Commands to Get Public IP using Linux Terminal
Method 1 – Using ifconfig Command
ifconfig command is generally available under /sbin directory. So you will need root or sudo access to run this on many of operating systems. Sample output: [Some output hidden] As per above output, this system has IP address 192.168.10.199 on Ethernet interface eth0. You can also view the specific interface details by specifying the interface name on the command line as below.
Read: bash ifconfig: command not found on CentOS/RHEL 7
Method 2 – Using ip Command
ip command generally available under /bin directory but some Linux os keep is under /sbin directory. Use the following command to get ip address using ip command. Sample output: [Some output hidden] As per the above output, this system has IP address 192.168.10.199 on Ethernet interface eth0. The interface eth1 doesn’t configure with an IP address. You can also view the specific itnerface details using below command Find more commands to check local ip address of any Linux system.