Killing a tree of processes in top/htop

htopkilltop

htop allows me to nicely see trees of processes within the shell. I can kill processes by pressing F9 (KILL) and then selecting which signal (e.g. 15 SIGTERM) I want to send to a job to kill.

However, this only allows me to kill one process at a time. Is there a way to kill a full tree of processes using htop?

Best Answer

From man htop:

INTERACTIVE COMMANDS

Space Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of tagged processes, instead of the currently highlighted one.

U Untag all processes (remove all tags added with the Space key).

F9, k "Kill" process: sends a signal which is selected in a menu, to one or a group of processes. If processes were tagged, sends the signal to all tagged processes. If none is tagged, sends to the currently selected process.

Not quite the answer you were looking for, but close. You can also eliminate process groups or children with kill, see:

https://stackoverflow.com/questions/392022/best-way-to-kill-all-child-processes

Related Question