How to stop all old process in one command

Posted on 2010-01-07
Last Modified: 2013-12-06
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
Question by:supportpro
    LVL 48

    Expert Comment

    Assuming a modern version of HP-UX

    pkill bp

    or the longer way

    ps -ef | awk '/[b]p {print $2}'  | xargs kill

    Author Comment

    # 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
    LVL 76

    Accepted Solution

    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,
    ps -ef | awk '/[b]p/ {print $2}'  | xargs kill

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now