Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to kill all the child process.

The main process in lmbench

pkill -9 lmbench 

is not killing it, but

kill -9 <pid>

kills the parent process,

but even after killing the parent process some process from /usr/lib/lmbebch/bin keeps running,

How to kill all process or executables located inside /usr/lib/lmbench ?

or kill lmbench with its children.

I cannot use ctrl + c as I start it from a shell script and use pipe to control lmbench

Solved the problem by using

busybox killall -9 lmbench
busybox pkill -P $lmbenchPID

but is there any single command way?

lmbenchDriver.sh is the shell script that calls lmbench

so after lmbenchDriver exits, I still can see process

lmbenchDriver, lembench, mem, line,

share|improve this question

Try to use

pkill -P PPID

which should kill all children of parent process with ID = PPID.

share|improve this answer
busybox killall -9 lmbench busybox pkill -P $lmbenchPID together solved the problem – limovala Aug 16 '13 at 8:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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