SUSE Linux 15 netstat命令不支持
suse15-sp3:~ # netstat -anp
If 'netstat' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf netstat
suse15-sp3:~ #
但在SUSE Linux12时是支持netstat
suse-12-sp5:/ # cat /etc/os-release
NAME="SLES"
VERSION="12-SP5"
VERSION_ID="12.5"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp5"
suse-12-sp5:/ # netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:59681 0.0.0.0:* LISTEN 2741/KvEdrSvc
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1736/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2161/master
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 2332/0
1、检查是否安装net-tools,已安装,但问题未解决
2、度娘,部分也是安装网络工具,也有说后续版本不再支持netstat工具
解决:
SUSE Linux 15不支持netstat,支持命令ss
如下:
suse15-sp3:~ # ss -anp|grep :22
tcp LISTEN 0 128 users:(("sshd",pid=1382,fd=3))
tcp ESTAB 0 36 users:(("sshd",pid=2660,fd=4))
tcp LISTEN 0 128 users:(("sshd",pid=1382,fd=4))
suse15-sp3:~ # ss -anp|grep KvEdr|wc -l
15
suse15-sp3:~ #