We can list zombie processes by using the ps command and piping its output into egrep command. Zombie processes have a state flag of "Z," and you'll usually also see "defunct."
Type the following command on a terminal:
ps aux | egrep "Z|defunct"
The zombie process will be listed and you can also see the program that spawned these zombies.
Once we have the process ID of the first zombie, we need to find the process ID of its parent process. We can do so by using ps again. We'll use the output option (-o) to tell ps to display only the parent's process ID, and then pass it with the ppid= flag.
The process we want to find will be indicated by using the -p (process) option, and then passing in the zombie's process ID.
Therefore, we type the following command to look up the process information for process with ID = 7641, and it will only report the ID of the parent process:
ps -o ppid= -p 7641
The output of the command will be the ID of the parent process then you can use the kill command to terminate the parent process if that is safe to do and the zombie process will go away.
Taken from: https://www.howtogeek.com/701971/how-to-kill-zombie-processes-on-linux/
Output:
2024-01-01 New Year's Day
2024-01-15 Martin Luther King Jr. Day
2024-02-19 Presidents' Day
2024-05-27 Memorial Day
2024-06-19 Juneteenth
2024-07-04 Independence Day
2024-09-02 Labor Day
2024-10-14 Columbus Day
2024-11-11 Veterans Day
2024-11-28 Thanksgiving Day
2024-12-25 Christmas Day