In a Linux operating system environment, a process is defined as a program in execution or one that is already running. A program only becomes a process when it starts running/executing. This program execution trail that translates to a process is associated with inputs and outputs.
Available system resources/services are often utilized by the processes as mandatory inputs to achieve a targeted system objective (output). A PID or Process ID uniquely identifies each process on your operating system.
[ You might also like: How to Find Top 10 Running Processes by Memory and CPU Usage ]
Process management through tools like Htop process viewer creates effortless Linux administration routines as it helps an OS user or administrator deal with system issues relating to:
- Process communication: You might be unsure whether a specific process is running or fulfilling its OS functional objectives.
- Deadlock handling: Due to limited and highly prioritized system resources, one process can be waiting on a resource held by another process which is also waiting on another resource held elsewhere. This situation leads to several highly prioritized processes existing in an indefinite paused state.
Solving the above-mentioned process communication and deadlock handling issues is possible through the Htop process viewer.
It is a powerful process viewer, process manager, and system control Linux tool that continuously reveals an updated list of all running processes and their associated resources and activities in relation to an active and authenticated Linux user.
Htop’s flexible interpretation of system processes makes it a better candidate to top command (an older process viewer and manager for Linux).
While top focuses on the display of resource-intensive processes, Htop will list and display all available and running processes on your Linux system.
How to Install and Use Htop in Linux System
To install Htop on a Linux operating system distribution of your choice, reference one of the following installation commands:
$ sudo apt-get install htop [On Debian, Ubuntu and Mint] $ sudo yum install htop [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge sys-process/htop [On Gentoo Linux] $ sudo pacman -S htop [On Arch Linux] $ sudo zypper install htop [On OpenSUSE]
After Htop has successfully installed on your Linux OS, you can launch it by keying in the following command on your Linux terminal:
You will be met with an interface similar to the above screen capture, where htop provides very detailed information about your Linux system.
For instance, the screen capture above reveals critical information on the main memory/RAM (Mem) usage, Swap memory (Swap) usage, and Tasks together with their total and active threads (thr) of a highlighted process (In blue).
Threads (thr) represent sequential tasks that a single highlighted process can handle.
The bottom section of the Htop interface represented by the screen capture below highlights other important process-related information such as PID (Process id), USER (owner of the process), PRI (Process Priority), RES (Resources used by the process), CPU% (CPU percentage allocated for the execution of the process), and MEM% (main memory or RAM used by the process).
As for the function keys highlighted at the bottom of the screen capture (F1 to F10), the F6 function key, for instance, gives you some flexibility on how your processes should be displayed.
F3 function key lets you search for a specific process. You will be able to know if it is active or inactive.
With the F9 function key, you can kill any highlighted running process that might be affecting the health of your operating system.
Before confirming your KILL decision by hitting [Enter] on your keyboard, you will have other send signal options apart from SIGKILL (kill a process signal) as depicted by the above screen capture.
Htop is a flexible Linux tool for process viewing, process management, and system control as you do not have to memorize any terminal commands for managing or viewing targeted processes. It is terminal-based but GUI-oriented. To learn more about its extensive usage options, run
man htop on your Linux terminal.