0 系统环境
CentOS 7.4
# rpm -q centos-release
centos-release-7-4.1708.el7.centos.x86_64
1 问题
系统可能没有安装 netstat
-bash: netstat: command not found
2 解决方法
yum 直接安装
yum -y install net-tools
查看nginx打开的端口
# netstat -luntp|grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12223/nginx: master
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN 12223/nginx: master
tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN 12223/nginx: master
tcp 0 0 0.0.0.0:8003 0.0.0.0:* LISTEN 12223/nginx: master