Linux 根据目录名Kill此目录下执行的所有进程

来源:互联网 发布:图像语义分割算法论文 编辑:程序博客网 时间:2024/06/05 08:30

常用的根据进程号杀掉进程,拿Tomcat举例说明:

在linux下查询tomcat进程:

ps -ef | grep tomcat。
删除tomcat进程 用kill -9 进程号 强制杀进程。 

下面的是根据目录名Kill此目录下执行的所有进程:
ps aufx|grep tomcat|grep 509|awk '{print $2}'|xargs kill -9
或者使用
ps -ef | grep /data/tomcat/ | grep /data/tomcat/ | cut -c 9-15 | xargs kill -9

0 0
原创粉丝点击