How to Kill a Process in htop?
This article provides a straightforward, step-by-step guide on how to
find, signal, and terminate processes using the htop
interactive process viewer in Linux. You will learn the specific
keyboard shortcuts required to open the signal menu, how to select
different termination signals like SIGTERM and
SIGKILL, and how to safely close stuck applications
directly from your terminal interface.
Step 1: Launch htop
Open your terminal and start the utility by typing htop
and pressing Enter. If it is not installed, you can typically install it
via your package manager (e.g., sudo apt install htop on
Ubuntu/Debian or sudo dnf install htop on Fedora/RHEL).
Step 2: Locate the Target Process
Once htop is running, you need to find the process you
want to manage. You can navigate the list using the Up and Down
arrow keys.
To speed up the process, you can search or filter the list:
- Press
F3(or/) to open the search bar and type the name of the process. - Press
F4(or\) to filter the list so only processes matching your search term are displayed.
Step 3: Open the Signal Menu
After highlighting the target process with your cursor, you can initiate the kill command:
- Press
F9(or thekkey) to open the signal menu on the left side of the screen.
Step 4: Select and Send the Signal
The signal menu lists various Unix signals you can send to the process. Use the arrow keys to choose the appropriate action:
15 SIGTERM(Standard Kill): This is the default and safest choice. It requests the process to terminate gracefully, allowing it to save its current state and release resources.9 SIGKILL(Forced Kill): Use this if the process is completely frozen and unresponsive toSIGTERM. It forces the operating system to immediately terminate the process without letting it clean up.
Once you have highlighted your desired signal, press
Enter to send it. The process will be signaled
immediately, and if terminated, it will disappear from your
htop display.