网络端口监控

Ubuntu 16.04.3

查看指定端口的pid

netstat -anp|grep 9110|awk '{printf $7}'|cut -d/ -f1

shell中自动查询端口pid+kill

pid=$(netstat -anp|grep 9110|awk '{printf $7}'|cut -d/ -f1)

kill -9 $pid

查看防火墙端口
ufw status


开启指定防火墙端口
ufw allow 9003

猜你喜欢

转载自blog.csdn.net/qm5132/article/details/82722380