1、根据程序名称来查杀 比如:我想将tomcat的进程杀掉
ps -ef|grep tomcat 查看tomcat的pid
kill -9 pid
2、根据端口号来查杀
lsof -i:8080 查看占用8080端口的程序(注意:centos上执行这个命令可能出现
-bash: lsof: command not found这个错误。这个错误很简单,安装一下lsof就行。执行
yum install lsof
)
kill -9 pid