可以通过 ifconfig 命令来查看本地IP地址,正常的结果如下:
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.89.129 netmask 255.255.255.0 broadcast 192.168.89.255 inet6 fe80::45fb:9d4a:7d48:3797 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:e1:c5:f3 txqueuelen 1000 (以太网) RX packets 300224 bytes 387989103 (387.9 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 115129 bytes 7165354 (7.1 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (本地环回) RX packets 3422 bytes 316027 (316.0 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3422 bytes 316027 (316.0 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
如果提示命令没找到,通过下面的命令先安装:
sudo apt install net-tools
本文为宁若水!原创文章,转载无需和我联系,但请注明来自[若水]博客 www.lalaya.net