htop is a terminal-based system monitoring application. It allows you to see memory usage, processor usage, amount of tasks, load averages, process list, and more in a human-readable format.
The installation is quite simple.
Open a terminal and run:
sudo apt install htop
The installation is completed and now you can run it with the following command:
You should see a similar output:
The htop interface is quite simple to understand.
On the top of a screen, we have the information of a CPU and RAM usage, Swap, number of tasks and threads, load level, and uptime.
And below that, we can see all the processes that are currently running on your system. This information is shown in a table form.
- PID: Process ID
- USER: Process owner
- PRI: Kernel's internal process priority
- NI: The nice value of the process, which affects its priority
- VIRT: The amount of virtual memory used
- RES: Amount of physical memory used in kilobytes
- SHR: Shared memory used
- S: Process status; can be Sleeping, Zombie or Running
- CPU%: Percentage of CPU used
- MEM%: Percentage of RAM used
- TIME+: Process uptime
- COMMAND: command that executed the process
At the bottom, you will find the rest of the options.
- F1 Help: display the program help
- F2 Setup: you can change the htop color scheme
- F3 Search: This allows you to search for a process by entering a keyword.
- F4 Filter: Filter processes
- F5 Tree: Enables a tree view of the processes
- F6 SortBy: Sorts the processes
- F7 - F8: Renice a process
- F9: Kill a process.
- F10 Quit: Close htop
One of the most useful commands is Kill a process. Navigate with the arrow keys, select a process you would like to kill and press F9. The process is killed.