[root@sqj2015 ~]# top
![]()
因为状态为z或者Z的进程为僵尸进程,所以我们使用grep抓取stat状态为zZ进程
[root@sqj2015 ~]# ps -A -o stat,ppid,pid,cmd | grep -e ‘^[Zz]’
Z 727098 229156 [webmaild – serv]
这样我们就可以执行下面命令来杀死僵尸进程:
kill -9 727098
如果将僵尸进程过多,这样处理的速度有点慢,可以执行下面命令来快速杀死所有的僵尸进程:
[root@sqj2015 ~]#ps -A -o stat,ppid,pid,cmd | grep -e ‘^[Zz]’ | awk ‘{print $2} |xargs kill -9’
再查看,就会发现僵尸进程没有了!
