Killing User Processes the Easy, Fun Way

If you need to delete a user, but userdel reports that some of the user’s processes are running. You sure would like single command to find and stop all of the user’s processes, use the slay program:

# slay foober
slay: -KILL is kicking foober’s butt!
slay: Whoa, I have the power supreme.

slay finds and kills all the user’s processes at once, saving you the trouble of hunting them down and killing them yourself. slay has four modes: nice, normal, mean, and butthead. Mean mode kills any nonprivileged user who attempts to slay another user. Set your desired mode in /etc/slay_mode.

The traditional method of finding processes belonging to a user is to use ps, as in:

$ ps U 1007


$ ps U foober
3936 ? S 0:00 xchat
3987 ? S 0:00 /usr/lib/galeon-bin
4209 ? S 0:00 kdeinit: kio_file file /tmp/ksocket-carla/klauncherkF21rc.slave-

You can then kill one by one:

# kill 3936
# kill 3987
# kill 4209