On Thu, 25 Feb 1999, Dan Browning (Network Admin) wrote:

> Truly, I'm not trying to flood the list with stupid questions, it just comes
> so naturally to me.
> 
> 1.  There must be a command out there that translates the name of a process
> into it's PID, what is it?

ps aux | grep <name>

Usually, it'll give you a line with grep.

> 2.  How could I kill all processes that have a certain name?

man killall

> What about killing all processes with a certain pattern in their name,
> how could I do that?

Given pattern foo (and you'd want to exclude any process with "grep" in
its name so you didn't kill the process that was trying to kill things
<g>):

ps aux | grep foo | awk '{print("kill "$2)}' | /bin/sh

_Deirdre  *  http://disclaimer.deirdre.org  *  http://www.deirdre.net
"I would rather choose to have my leg bitten off than to buy NT"
Rob Narberes, Information Systems Manager, DNA Plant Technologies Corp
as quoted in (!) Computerworld

Reply via email to