Home > Article > System Tutorial > Do you know the simple way to check IP in Linux system?
Easy way to check IP in Linux system
In Linux systems, we generally know that IP is the network address Linux space on the computer, and it is not easy to know how to check the IP. Sometimes, we need to check the IP either logged in to the local machine or the remote server. So, next we will introduce a simple way to check the IP in the Linux system.
1. Use ifconfig command
The ifconfig command is the most commonly used tool in Linux for viewing IP addresses. This command is included in most distributions of Linux. Through the ifconfig command, we can see the network information and associations of all network cards on the machine. status, such as IP, subnet segment, etc. The way to check the IP address of this machine is:
ifconfig | grep inet<br>
After the command is executed, we can see the local IP address.
2. Use ip command
The ip command is a more powerful network tool provided in the Linux kernelLinux system to view the IP address, which completes more functions than ifconfig. Through the ip command, we can see the IP address of the machine, such as the Internet address, loopback address and other Linux scheduled shutdown commands. The way to check the IP address of the machine is:
ip addr show<br>
After the command is executed, Linux system checks the IP address, and we can see the local IP address.
3. Use hostname command
The hostname command is a commonly used tool in Linux systems for displaying computer names. We can use the hostname command in Linux systems to view the local IP. To view the local IP address, just execute the following command:
hostname -I<br>
4. Use nslookup command
The nslookup command is used to find the domain name or IP. You can use the nslookup or host command to view the local IP address:
nslookup<br>
or:
hostname -i<br>
The above is the detailed content of Do you know the simple way to check IP in Linux system?. For more information, please follow other related articles on the PHP Chinese website!