Slay a type of process owned by a user Need to kill a set of processes quick and dirty? Here's a somewhat safe way to do it.
Contributed by: Unknown User anonymous2 [02/19/04 | Discuss (4) | Link to this hack]
Of course, this is just killing a list of pids - you can use the line without the kill + backticks just to get a list of pids.
And always, there is the program 'slay', which will do this for you much easier. However, slay is not available on most systems so you're better off using this instead.
Haven't tested on a SysV ps.
Comments on this hack
Showing messages 1 through 4 of 4.
it's very system dependent
2004-04-12 14:15:28
winkydink
[View]
ps aux |awk '$11 ~ /^foobar/ {print $2}' |xargs kill -9
A lot of systems support killall, but don't try it on a Solaris box :)