How to Install Htop and Use it to Monitor Linux Processes?

Generally, we run lot of commands to get informations for Linux processes. We can use a tool name Htop to avoid running multiple commands and get lot of valuable information in one screen. Htop is an interactive process viewer tool for Linux systems that will show all processes in a Task Manager without wasting resources. Here, i will show you how to install Htop and its uses to monitor the Linux processes.

HTOP is a process viewer on the terminal created for the entire Unix family but has great popularity within GNU/LINUX. The main advantages of this tool are that we can monitor processes, finalize and explore them all from the terminal which guarantees a minimum expenditure of resources.

 

htop screen

How to Install Htop on Various Linux Systems?

We can install Htop from your sources or simply from pre-compiled packages. However, Htop is found in most GNU/LINUX distributions through its main repositories. Please have a look at the step by step process to install Htop on Debian, RHEL, Ubuntu and other Linux systems.

Install Htop on Debian 8 Jessie and Debian 9 Stretch

The first thing we need to do is login as root. Type su on your terminal window and press enter followed by typing its password.

su

Once you will be connected using su account, run below command to install Htop on Debian systems.

apt install htop
Install Htop on Ubuntu 14.04  and Ubuntu 16.04

Here, I will show you how to install Htop on Ubuntu servers. Installation of htop on Ubuntu is very much similar to installing it on Debian as we did in above section. In the case of Ubuntu, we must be root user to install htop. Type su and press enter followed by its password.

su

Once we will be connected using root user, we will proceed to install htop on Ubuntu by running below commands. A set of execution will start and execution will finish with its installation.

apt install htop
Install Htop on Fedora 26 and Fedora 27

There is little different way to install Htop on Fedora systems as we use dnf command to install it on fedora. Fedora users can easily install htop as following below steps. First we connect to root privileges using su account. Type su and its password.

su

Once we will be connected using su account, we can invoke dnf which is Fedora package manager. Run below dnf command to install htop on Fedora systems. A set of execution will start and finish with htop installation.

dnf install htop
Install Htop on Gentoo

For Gentoo we must also be root users. Write in a terminal:

su

Once we connected with root user permissions, we can install Htop by invoking Gentoo’s own package manager emerge. Run below command to start Htop installation on Gentoo system. A series of execution will start and finish with its installation.

emerge sys-process/htop
Install Htop on CentOS 7 and Red Hat Linux Enterprise

In the case of CentOS 7, we must first add the EPEL repository and then install it normally. First we logged in as root user to get installation privileges. Connect using su account by typing below command and its password.

su

Once logged in as root user, we proceed to download the package containing the EPEL repository:

wget http://mirror.pnl.gov/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

And then install the downloaded package to add the EPEL repository:

rpm -Uvh epel-release-7-5.noarch.rpm

The next step is to “validate” the newly added repository by running below command.

yum repolist

And Finally we will install htop on RHEL and Centos by running below command.

yum install htop 

Basic use of HTOP

We have installed Htop on various Linux systems in above section. We must write the command htop To launch it. Here, it is not necessary to do it as root user. You can see i wrote htop on terminal window and press enter to get the Htop task manager screen in below image.

Type htop to launch its screen

You will get below screen once you execute above command on your terminal screen.

htop running screen

It’s the initial screen. As we can see, it is very simple and easy to understand. We can have fun in three parts that we will study. In this “first part” we see the use of the processor and RAM by all processes along with other details. On the right side a small summary of them: how many tasks are running and the total active time.

Top section of htop window

“Second part” also you can say middle part is the main view where all the processes are showing. You can see this in below image.

Main Processes View

This is where we have the information through columns that contain details about these processes. The columns are:

  • PID: Displays the process identifier number.
  • User: The user tells us that he has activated this process.
  • PRI: It shows the priority with which the process is executed.
  • NI: Shows the priority level
  • VIRT: The number of virtual memory used by the process.
  • RES: Used ram memory (Megabytes)
  • SHR: Shared memory used
  • S: Process status (Running, sleeping or zombie)
  • CPU%: percentage of CPU used by the process
  • MEM%: percentage of ram memory used by the process
  • TIME+: Active life-time of the process
  • Command: The command that executes the process.

So with this we have all the information of the processes that are running at that time.

The “last part” displays the tools provided by Htop for navigation. For example, allows us to search, sort the processes and the best, for me, the “kill” processes by using shortcut keys.

Lower section of Htop

To kill a process we must navigate through the processes with the up and down keys, select it, press the F9 key, and choose the number that corresponds to the option of killing that serves us. I almost always use the 9th showing in below screen.

htop kill screen

In conclusion we can say that Htop is a great tool to visualize the active and non-active processes in our Linux systems. Being terminal-based, it has the advantage of consuming virtually nothing in resources and helps us to close very heavy or unnecessary processes.

Here i have shown you how to install Htop on Red Hat, Ubuntu, Fedora and Debian systems and its uses. I hope you like this article. Please follow our Facebook page and Twitter handle to get latest updates.

Read More:

Angelo Marquez
Summary
Article Name
How to Install and Use Htop on Linux Systems?
Description
We need to run lot of commands to get informations for Linux processes. We can use a tool name Htop to avoid running multiple commands and get lot of valuable information in one screen. Htop is an interactive process viewer tool for Linux systems that will show all processes in a Task Manager without wasting resources. Here, i will show you how to install Htop and its uses to monitor the Linux processes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *