Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to check ip address with command in linux

Shulou Source: shulou.com Published: 2022-06-03 03:33:32 09月22日 Update

First of all, the more commonly used command is ip a s. Execute ip a s on the command line to output all the network card information, including the virtual network card.

If there are more network cards, we should judge based on experience. That is the network card ip you want. I have four network cards here, usually en0, and I have em4 here. Check the inet inside is the ip address.

In fact, the ip address of each network card is its own local ip, and only the ip of the same network segment can access each other. The ip a s command is abbreviated, and the full name is ip addr show, which is equivalent to ip a s.

If the last command is executed, the prompt can not find the command, there is no hurry, there are many commands below you can check ip, here is the execution / sbin/ifconfig, you can output ip

The output is similar to the previous command, but this Nic has blank line isolation.

This command can also be abbreviated, and you can execute ifconfig directly, because if you put it in the sbin directory, you don't have to enter the full path.

These are the details of what is the command to check the ip address in linux. Please pay attention to other related articles for more information.

Tags: Commands network cards addresses that is output content abbreviations almost no information full name but commonly used articles more directories experience network segments paths local machine Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi MySQL Microsoft Huawei