Operations 2 min read

How to Locate and Eliminate Zombie Processes with ps and grep

This guide explains how to use the ps and grep commands to identify zombie processes on Linux, interpret the output fields, and terminate them safely by sending signals to the appropriate parent or child processes, with example commands and verification steps.

Open Source Linux
Open Source Linux
Open Source Linux
How to Locate and Eliminate Zombie Processes with ps and grep

Finding Zombie Processes with ps and grep

ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]'

Command explanation:

A : lists all processes.

-o : custom output fields.

We display stat (status), ppid (parent PID), pid (process ID), and cmd (command). Processes whose stat is Z or z are zombie processes, so we filter with grep.

Sample output: Z 12334 12339 /path/cmd To terminate the zombie, send a hang‑up signal to its parent process: kill -HUP 12339 Run the original ps command again to verify the zombie is gone. If the child cannot be killed, terminate the parent process instead:

kill -HUP 12334

Using top to Observe Dynamic Process Table

Top command showing zombie processes
Top command showing zombie processes

In the top display, zombie processes are marked as zombie.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

process managementLinuxGreppszombie process
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.