What is IP Address
A unique number consisting of four parts separated by dots. Every device on the Internet (and on any network) must have a unique IP address to participate and be part of it. An example of an IP address is:

This article will show you how to find the IP address of your local machine through command line in LINUX. To get your internal IP, you can run the following commands:

Example 1 – Ifconfig
The ifconfig command is used to configure a network interface (that is, to associate an IP address with a network device). If you run ifconfig without any command-line arguments, the command displays information about current network interfaces.
ifconfig -a

Example 2 – ip addr
To get the depth information of your network interfaces like IP Address, MAC Address information, use the following command as shown below.
ip addr

Example 3 – hostname
The hostname command is used to show or set a computer’s host name and domain name. It is one of the most basic of the network administrative utilities.
hostname -I

Example 4 – nmcli
nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilised as a replacement for nm-applet or other graphical clients.

It is also used to create, display, edit, delete, activate, and deactivate network connections, as well as control and display network device status.

nmcli device show

Example 5 – ip route
IP route command is used to configure the static route. Static routes are the most secure way of routing. They will also increase overall network performance. These features are extremely helpful in small network.
ip route get | awk ‘{print $7}’

And with the help of below commands, you can easily get your external public IP address directly from the command line:
curl ipinfo.io/ip
curl ifconfig.me
dig +short myip.opendns.com @resolver1.opendns.com
curl checkip.dyndns.org
host myip.opendns.com resolver1.opendns.com