How to install and use htop to monitor system processes in CentOS 8

How to install and use htop to monitor system processes in CentOS 8

Htop is an upgraded adaptation of top order. It shows all procedures running on the system by PID in addition to uptime, load normal, memory use, and other significant insights. It shows the data in an efficient way, which permits the clients to discover the framework matrics without any problem. In this instructional exercise, we will take a look at how we can use htop in CentOS 8.

Official htop here

Install and use htop

Installation of htop

Open your terminal window.

For Remote CentOS Server, you need to connect via ssh.

You need to have EPEL Repo enabled in your system. If you don’t have EPEL Repo you need to install it by using the following command one by one:

sudo yum -y install epel-release
sudo yum repolist

That will look like the images below

 

Now check that htop is available on the repository.

sudo yum search htop

 

As we can see the htop package is available on the repository, now we can install it by simply using this command

sudo yum install htop

 

So now htop is installed on our machine, to run htop just type

htop

 

It will run htop on the terminal and looks like this.

How to install and use htop to monitor system processes in CentOS 8

How to install and use htop to monitor system processes in CentOS 8

 

htop Commands & usage:

We can find the menu of htop in the bottom section of the terminal.

Press F1 for help.

 

Press F2 for Setup

 

Press F3 for Search Process., here I searched for gsd-color and it is highlighted in the terminal.

 

Press F4  to Filter process, here I have filtered the process of /usr/libaxec

 

F5 will show you tree view of the processes.

 

You can also use

F6 to collapse the view.

F9 to Kill process and

F10 to Quit htop.

 

htop Keyboard Shortcut for CentOS 8

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.
PgUp, PgDn 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.
s Trace process system calls: if strace(1) is installed, pressing this key will attach it to the currently selected process, presenting a live update of system calls issued by the process.
l Display open files for a process: if lsof(1) is installed, pressing this key will display the list of file descriptors opened by the process.

Other keyboard shortcuts

u Show only processes owned by a specified user.
M Sort by memory usage (top compatibility key).
P Sort by processor usage (top compatibility key).
T Sort by time (top compatibility key).
F “Follow” process: if the sort order causes the currently selected process to move in the list, make the selection bar follow it. This is useful for monitoring a process: this way, you can keep a process always visible on screen. When a movement key is used, “follow” loses effect.
K Hide kernel threads: prevent the threads belonging the kernel to be displayed in the process list. (This is a toggle key.)
H Hide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.)
p Show full paths to running programs, where applicable. (This is a toggle key.)
Ctrl-L Rfresh the screen.
F1 See this help menu.

 

Conclusion

In this tutorial we have learned how to add EPEL Repo and install htop in CentOS 8. We have also learned the htop menu functions and keyboard shortcut. I hope this tutorial will help you with a better understanding of htop command.

 

#htop

You may also like...

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments