CentOS7 之ifconfig, netstat 取代命令

官方wiki解释是

ifconfig 及 netstat 工具程序在 CentOS 5 及 6 的应用手册内被置标为降级已接近十年,而 Redhat 决定在 CentOS 7 不会缺省安装 net-tools 组件。其中一个转换的原因就是 ifconfig 不会显示界面卡所拥有的全部 IP 位置 —— 请改用 ip 指令。取而代之的工具是 ss 和 ip。假如你真的、真的很需要 ifconfig 和 netstat,你可执行 yum install net-tools。

那就熟悉用这些命令吧

ip 替代 ifconfig

ip a
ip route

ss 替代 netstat

比较好的格式化输出命令为:ss -ntulp | colume -t

Screen Shot 2019-08-20 at 22.22.58.png

还有 ss -nulp4 | cat -A