Input:
ifconfig eth0
The eth0 represents the first NIC of the host.
Output:
eth0:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> MTU theinet192.168.118.136Netmask255.255.255.0Broadcast192.168.118.255Inet6 fe80::20c:29ff:fe2c:3c8f Prefixlen -ScopeID0x20<link>etherxx: 0c: in: 2c:3c:8f Txqueuelen +(Ethernet) RX packets153785bytes172057146(164.0MiB) RX Errors0Dropped0Overruns0Frame0TX Packets67213bytes9694191(9.2MiB) TX Errors0Dropped0Overruns0Carrier0Collisions0
Rx for the received packet, TX for the sent packet. ether 00:0c:29:2c:3c:8f is the MAC address.
Input:
ifconfig grep ' '
Output:
192.168. 118.136 255.255. 255.0 192.168. 118.255
Displays all rows that contain ' inet '.
Cut command:
Syntax format:cut [-bn] [file] or cut [-c] [file] or cut [-DF] [file]
-B for extracting bytes,-C for extracting characters (Chinese characters contain two bytes),-D for custom delimiters, and tab by default. -F is used with-D to specify which area to display.
The grep, cut of the Linux command