If you need to delete a user, but userdel reports that some of the user's
processes are running, 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 1007or:
$ 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
Learn more about this topic from Linux Cookbook.
Linux information can be found scattered in man pages, texinfo files, and source code comments, but the best source is the experts who have built up a working knowledge of managing Linux systems. The Linux Cookbook's tested techniques distill years of hard-won experience into practical cut-and-paste solutions to everyday Linux dilemmas. Use just one recipe from this collection of real-world solutions, and the hours of tedious trial-and-error saved will more than pay for the cost of the book. It's more than a time-saver; it's a sanity saver.

Help

