in reply to How do i obtain the PID of a program already running.

ps -C program_name

From the Chatterbox earlier today, you were wanting to kill all the apache PID's with Perl...

shell> ps -C httpd | perl -pe '($_)=/(\d+)/;`kill -9 $_`'
That should work as root

Enjoy!

--
Casey

Replies are listed 'Best First'.
RE: Answer: How do i obtain the PID of a program already running. UPDATE
by cwest (Friar) on Jun 29, 2000 at 19:25 UTC
    I can't update my own posts... grrr!

    Change perl -pe to perl -ne actually...

    ps -C httpd|perl -ne'($_)=/(\d+)/;`kill -9 $_` if $_'
    
    That seems better to me.
    --
    Casey