The htop
command is a system monitoring tool for Linux that provides an interactive and real-time view of the system processes. Here is a tutorial on how to use the htop
command:
- Open a terminal window: To access the Linux command line, you can use the terminal application, which is usually found in the “Utilities” or “System Tools” section of the application menu.
- Install
htop
: Ifhtop
is not already installed on your system, you can install it using your system’s package manager. For example, on a Debian-based system, you can run the following command:
sudo apt-get install htop
- Run
htop
: To runhtop
, simply enter the following command in the terminal:
htop
- Understanding the
htop
interface: Thehtop
interface displays a list of all running processes on the system, along with information such as the process ID (PID), user, CPU usage, memory usage, and status. You can navigate the list of processes using the up and down arrow keys, and you can sort the list by a specific column by clicking on the column header. - Search for a process: To search for a specific process, you can use the
/
key to enter search mode, and then type the name of the process you want to search for.htop
will highlight any matching processes in the list. - Kill a process: To kill a process, you can select the process in the list and then press the
F9
key. This will bring up a menu of options, including the option to kill the process. - View process details: To view detailed information about a process, you can select the process in the list and then press the
Enter
key. This will open a new window with information such as the command line arguments, environment variables, and open files. - Quit
htop
: To quithtop
, press theq
key.
These are the basics of using htop
. htop
provides many other features and options, such as the ability to filter the process list, configure the display, and manage process priority. To learn more about these features, you can consult the htop
manual page by running the following command:
man htop