Ubuntu – kill process with htop

htop

Sometimes I need to kill a process and for that purpose I enter htop, search (/) for some string and then intend to kill the associated process.

The problem is that usually the processes are in motion (due to new processes being added and attributes changing) – so by the time I pressed F9 and went on with "killing" the process the selected process is already a different one.

Is there a way to handle this?

The reason why I use htop is of course b/c I sometimes have to guess which is the right process to get rid of and just a string is not sufficient for identification.

Best Answer

After executing sudo htop, just use the arrow keys to select the process you want to remove and then press either F9 or k then select which signal you want to send in the list (using the arrow keys) and press enter.

If you just to ask "politely" a process to quit use 3 SIGQUIT.

If you want to make sure the process quits use 9 SIGKILL.