报错
[root@stars ~]# netstat -an | grep -iw "listen"
-bash: netstat: command not found
解决思路
[root@stars ~]# yum search netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors.njupt.edu.cn
============================= Matched: netstat ==============================
dstat.noarch : Versatile resource statistics tool
net-snmp.x86_64 : A collection of SNMP protocol tools and libraries
net-tools.x86_64 : Basic networking tools
通过yum search 这个命令发现netstat这个命令是在net-tools.x86_64这个包里
接下来下载这个包即可
[root@stars ~]# yum install -y net-tools.x86_64
再次执行命令
[root@stars ~]# netstat -an | grep -iw "listen"
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::*
网友评论