Ps-a-O Stat,ppid,pid,cmd | Grep-e ' ^[zz] '
How to view and kill the zombie process under CentOS
Yesterday, the server expired, before the server due to small space, can not meet the current service requirements, the new purchase of a server, is currently debugging installation.
During the debugging process, there are many zombie processes found in the system, and now it's time to find these zombies and kill them.
View zombie processes in the system with top
And see what these zombies are programmed to do.
Ps-a-O Stat,ppid,pid,cmd | Grep-e ' ^[zz] '
Because the process of a state of Z or Z is a zombie process, we use grep to crawl the stat state for the ZZ process
The results of the operation refer to the following
There are 6 zombie processes here, we need to kill them all, execute the following command
Kill-9 16092
It's a little slow to handle, just a quick command to kill all the zombie processes.
Ps-a-O Stat,ppid,pid,cmd | Grep-e ' ^[zz] ' | awk ' {print $} ' | Xargs kill-9
Look again, the zombie process is gone.
Original address: http://www.bkjia.com/Linuxjc/906801.html