How to find and kill zombie processes in CentOS 8

s2 0

In UNIX and Linux operating systems, zombie processes, also known as stale processes, are those that are still running after the process is fully executed but still remain in the process table. In this tutorial we will learn how to review and terminate zombie processes in CentOS 8.

How to find zombie / broken processes in CentOS

To view zombie or broken processes, open Terminal and use the following command:

# ps aux | grep “defunct”

How many zombie processes are running?

To see how many zombie processes are running, you can use the commands below.

# ps aux | awk {'print $8'}|grep -c Z
# ps aux | awk '{ print $8 " " $2 }' | grep -wc Z
# ps aux | awk {'print $8'}|grep Z|wc -l

List the process ID of the zombie process

To list the process ID of the zombie processes, use the following command:

# ps aux | awk '{ print $8 " " $2 }' | grep -w Z

To end the zombie process, use the following command with the process ID. This will remove the zombie process running on your server. To do this, use the following command.

# kill -9 <PID>

diploma

In this tutorial we learned how to view the zombie process and its process IDs and how to terminate them.

How to find and kill zombie processes in CentOS 8