How to stop all old process in one command

I hve more than 200 old backup process running when I issue
ps -ef| grep bp

how can i kill all the 200 backup process in HPUX
supportproAsked:
Who is Participating?
 
arnoldConnect With a Mentor Commented:
do not know HP-UX, but I  know awk.
There is a missing closing /
Try without the xargs kill first
ps -ef | awk '/[b]p/ {print $2}'  
If you get a list of PID,
Run
ps -ef | awk '/[b]p/ {print $2}'  | xargs kill
0
 
TintinCommented:
Assuming a modern version of HP-UX

pkill bp

or the longer way

ps -ef | awk '/[b]p {print $2}'  | xargs kill
0
 
supportproAuthor Commented:
# ps -ef | awk '/[b]p {print $2}'
 syntax error The source line is 1.
 The error context is
                /[b]p {print >>>  $2} <<<
 awk: Quitting
 The source line is 1.


please provide the corrected syntax
0
 
supportproAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.