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.
After executing
sudo htop
, just use the arrow keys to select the process you want to remove and then press eitherF9
ork
then select which signal you want to send in the list (using the arrow keys) and pressenter
.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
.It is possible to tag (and untag) a process with [space]. To the tagged process(es) the kill signal will be sent.
use
htop
and note down the PID of the process. Exit by enteringq
then enter the command :
If it is owned by the root, then :
Hope this'll help you ....
First, press F6 which is the "sort by" option.
Then, under the "sort by" category on the left, select option PID and then press Enter. This should give you a more stable output.
Next, to locate a process, press F3 to search, type in the search, and then press F3 again to scroll through search results.
When the process is highlighted, press F9 two times quickly and then press 9 and then press Enter to kill the process.