linux查看端口占用情况

一、查看端口占用情况的命令:

lsof -i

二、查看某一端口的占用情况: lsof -i:端口号
netstat -nlpt|grep 9000   或者   netstat -nlpt|grep php-cgi
执行命令kill -9 pid号
php-fpm

三、结束占用端口的进程:killall 进程名
killall nginx

posted @ 2021-10-27 17:00  石铭  阅读(3409)  评论(0编辑  收藏  举报