Kill all processes by user

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
I have a user who keeps running CGI scripts that never fully remove themselves from the processes list. He has 90 some proceeses on there now.

Anyway, shouldn't the following kill all processes for {user}:
Code:
kill `ps -aux | grep {user} | awk '{print $2}'`

It's not working :mad:

Thanks,
Phi1.
 
I got a step farther with the following:
Code:
[root@server1 root]# ps -aux | grep {user} | awk '{print "kill",$2}' | sh
sh: line 12: kill: (7217) - No such process
 
Hello,

The kill program defaults to use the TERM signal... which is a way of nicely asking the program to leave... what you want is KILL!!! :D ... or "9" so.. you would use:

kill -9 `ps -aux | grep {user} | awk '{print $2}'`

John
 
Back
Top