Linux —— 查询端口对应进程,并杀死


查询端口对应PID

方式1:lsof命令

lsof -i:{端口号}

方式2:netstat命令

netstat -tunlp|grep {端口号}

杀死进程

kill -9 {pid}

相关