
Introduction
Many Linux users are familiar with the top command-line utility to check which processes are consuming the most CPU or memory. While top is included by default in most distributions, there’s an enhanced version called htop that can be installed from most repositories.
htop is an interactive system-monitoring tool designed as an alternative to the traditional top. It displays a frequently updated list of all processes running on the system, typically sorted by CPU usage. Unlike top, which shows only the most resource-intensive processes, htop lists all processes. Additionally, htop uses color coding to provide visual information on CPU, swap, and memory usage.
In this tutorial, we’ll demonstrate how to install and use htop on an Ubuntu 16.04 system, but the steps will be applicable to all Debian and Ubuntu distributions available on BuycheapVPS.
Update System
Before starting, it's important to update your server. To do this, simply run the following command:
apt-get update
Installation
Once your server is up to date, installing htop is quick and easy. Simply execute the following command:
apt-get install htop
That’s all! htop is now installed and ready to use.
Usage
To launch htop, just type htop in the terminal. You’ll immediately notice the colorful, text-mode graph at the top of the screen. The output is similar to top, but with color coding and more interactivity:
htop

You can use the Up/Down arrow keys to navigate through the list of processes. To terminate a process, press the F9 key. To adjust the priority of a process, use F7 and F8. Additionally, you can press F6 to easily change the default sorting column.
Here are some useful key commands to help you get the most out of htop:
M: Sort processes by memory usage
P: Sort processes by CPU usage
?: Access the help menu
k: Kill the currently selected process (you can also use F9)
F2: Configure htop settings and display options
/: Search for a process
There are many additional options available through the help and setup menus. These should be your first stops when exploring htop's features.