Categories: CentOSLinuxShell

How to find and kill Zombie Processes in CentOS 8

In UNIX and Linux Operating System, Zombie processes also known as defunct processes, are those which are still running after the complete execution of the process but it still remains in the process table. In this tutorial, we will learn how to check and kill Zombie processes in CentOS 8.

How to find zombie/defunct processes in CentOS

To view Zombie or Defunct processes open up the terminal and use the following command:

# ps aux | grep “defunct”

How many Zombie Processes are running?

To view how many Zombie processes are running, you can use the following commands.

# 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 Zombie Process

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

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

To kill the Zombie process use the following command with the process id, it will remove the Zombie process running on your server. For this use the following command.

# kill -9 <PID>

Conclusion

In this tutorial, we learned how to display the Zombie process and their process IDs and how to kill them.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago