What is htop? How do I install htop on CentOS 7? We will cover these two questions throughout the article. Htop is an interactive process viewer for CentOS 7 systems. Many Linux administrators are familiar with the standard process management and activity monitor top. 

However, in some cases, the top does not provide all the information you might be searching for. This is where htop comes into play with a real-time and interactive interface with more features than the top.

From CPU utilization to sorting processes to setting priorities: all possible directly from htop. Htop is the predecessor for top command with many advantages.

  • Coloured output resource usage stats.
  • Ability to end or kill processes.
  • Htop allows mouse usage.
  • Higher performance compared to the top command.

To learn more about htop, pay a visit to the official website.

Prerequisites

To install htop on CentOS 7, you will need:

  1. A CentOS 8 machine
  2. Basic knowledge of Linux commands and the ability to use the shell.

By default, htop comes pre-installed on CentOS 8. However, if it’s missing on your system, use the following commands to set it up.

How to install htop on CentOS 7

Step 1:

  • Install the EPEL repository.

yum -y install epel-release

  • After enabling the EPEL repository, update the system.

yum update -y

Step 2:

  • With the repository added, you can install the htop process monitoring tool.

yum install htop -y

  • Once the installation is complete, you can find detailed information about htop.

yum info htop

Step 3:

  • Launch htop.

htop

Htop keyboard shortcuts

While inside htop, you can use the following commands.

Command

Description

Up arrow key

Select (highlight) the previous process in the process list. Scroll the list if necessary.

Down arrow key

Select (highlight) the next process in the process list. Scroll the list if necessary.

Left arrow key

Scroll the process list left.

Right arrow key

Scroll the process list right.

Space

Tag or untag a process

Pg Up / Pg Dn

Scroll the process list up or down one window.

Home

Scroll to the top of the process list and select the first process.

End

Scroll to the bottom of the process list and select the last process.

u

Show only processes owned by a specified user.

s

Trace process system calls

m

Sort by memory usage (top compatibility key).

p

Sort by processor usage (top compatibility key).

t

Sort by time (top compatibility key).

k

Hide kernel threads: prevent the threads belonging to the kernel from being displayed in the process list. (This is a toggle key.)

Ctrl + L

Refresh the screen.

F1

See the help menu.

F2

Setup

F3

Search

F4

Filtering: type in part of a process command line, and only processes whose names match will be displayed

F5

Tree view.

F6

Sorting

F7

Increase the selected process’s priority (only by a root user).

F8

Decrease the selected process priority

F9

Kill process

F10

Quit

CentOS htop alternatives

There are many htop alternatives also. We will note down the top 5 htop replacements that are free and Open Source.

  1. Glances: This is a CLI curses-based monitoring tool for GNU/Linux and BSD OS.
  2. GNOME System Monitor: Manage running processes and monitor system resources.
  3. Bashtop: Easy to use with a game-inspired menu system.
  4. KSysGuard: designed to make simple process control available to the user without any particular setup.
  5. vtop: Uses Unicode braille to chart CPU and memory usage.

Conclusion

During this short tutorial, we covered the procedure to install htop on CentOS 7. We also went through some basic keyboard shortcuts that can be used in htop.

We also reviewed some of the htop alternatives that can be used on your CentOS VPS. Many other features come packed with htop, which you can find on the official website. If you found this article helpful, don’t forget to share it with your friends.

People also read: