When I run top > 1, I get the following output:

I was reading this Q&A on Stack Overflow about how to delete sleeping child processes. I think those "child processes" are what I have shown here.

I ran a script which led to listing these sleeping processes. I killed the PID of the script, but noticed all of these sleeping processes still running.

I don't know what the process ID of those processes are, so I don't know how to kill them. Is there a way to know the parent process ID (PID) of the sleeping process?

How do I determine that PID so that I can kill them?

  • Um, most of the processes in that screenshot should not be killed as they take care of pretty important system functions.
    – Kusalananda
    Aug 26 '17 at 12:09
  • 1
    Also, please, don't post images of text.
    – Kusalananda
    Aug 26 '17 at 12:10

Please use the following command to find the PID of the process you wish to kill, e.g. 1811 is the child process.

ps -f 1811


ps -o ppid= 1811

This will return the parent process id which you can then use.

  • 1
    Hi thanks for commenting. Right, but how do I get the child PID?! In the screen shot there are several process' running on each core that are sleeping. I'm trying to determine any of their IDs so I can kill them. I tried your answer with the id in the screen ps -f 126918 but that returned an empty set of data UID PID PPID C STIME TTY STAT TIME CMD
    – Doug Fir
    Aug 24 '17 at 10:57
  • This response should help you - [askubuntu.com/questions/549781/…
    – nitinr708
    Aug 24 '17 at 11:02
  • Thanks for the link. I went there and typed their command to generate a list of sleeping PIDs. I then tried your answer and got No such process? For example, the last item on the list generated from the linked answers code snippet was 127566. So I tried ps -f 127566 which returned an empty data row again. Any ideas on where next?
    – Doug Fir
    Aug 24 '17 at 11:10
  • We can try to see what is blocking the process. Please try this - strace -p pid
    – nitinr708
    Aug 24 '17 at 11:18
  • strace -p 127566 strace: attach: ptrace(PTRACE_ATTACH, ...): No such process. This PID was taken from the list generated by ps h -eo s,pid | awk '{ if ($1 == "S" || $1 == "D") { print $2 } }'
    – Doug Fir
    Aug 24 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.