Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

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
0
supportpro
Asked:
supportpro
  • 2
1 Solution
 
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
 
arnoldCommented:
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
 
supportproAuthor Commented:
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now