How does CentOS 7 yum install htop?Explain in detail how to use the htop command in Linux

Many online marketers use the VestaCP panel ( CentOS 7) to build websites and do SEO.

  • LetE-commerceThe stable operation of the website is very important, so as to achieve the idealWeb PromotionEffect.

If the VPS memory is exhausted and a 500 error occurs, it can be used in SSH htop command to view the host process status.

However, a minimal installation of VestaCP does not include the htop monitoring tool by default, which may result in a "command not found" error message such as " -bash: htop: command not found".

  • This tutorial will explain this in detailLinuxUse the htop command method.

There are more Linux monitoring tool tutorials here ▼

What is htop?

  • htop is an interactive and real-time system monitoring process viewer written for Linux.
  • It is intended to replace top for Unix programs.
  • It shows a frequently updated list of processes running on your computer, usually sorted by CPU usage.

The difference between top and htop

  • Unlike top, htop provides a complete list of running processes, not the most resource-hungry ones.
  • Htop uses color and provides visual information about processor, swap, and memory state.

htop and top comparison

  • In 'htop' you can scroll the list vertically and horizontally to see all processes and the full command line.
  • In 'top', each unassigned key press is delayed (especially annoying when multi-key escape sequences are triggered accidentally).
  • 'htop' starts faster ('top' seems to collect data for a while before displaying anything).
  • In 'htop' you don't need to type the process number to kill a process, in 'top' you do.
  • In 'htop' you don't need to type the process number or priority value to render a process, in 'top' you can.
  • 'htop' supports mouse operations, 'top' does not
  • 'top' is older and therefore more used and tested.

yum install htop on RHEL/CentOS 5.x/6.x/7.x

By default, the ytop tool is not available in the yum repository.

Step 1: Enable the RPMForge repository

  • We enable the RPMForge repository.

RHEL/CentOS 7 64-bit:

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

RHEL/CentOS 6 32-bit:

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 rpm -ivh epel-release-6-8.noarch.rpm
  • CentOS 7 does not support 32-bit EPEL repositories, so use RHEL/CentOS 6 32-bit.

Step 2: Install htop using the yum command ▼

yum install htop

Step 3: Use the htop command ▼

htop

Download htop source code cross compile and install

If you prefer to compile and install htop from source, please download the source and compile it ▼

wget http://downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz#tar 
-xvf htop-1.0.2.tar.gz 
cd htop-1.0。 2 
./configure 
make 
make install
  • If you have installed htop using yum, skip this step.

How to use htop command?

After installation, simply type `htop` in the SSH terminal to start it. ▼

htop

At the top of htop, you can see the navigation with colors▼

At the top of htop, you can see a colored text pattern graphic.

Press " F2" or "S" to view the htop settings menu ▼

Press "F2" or "S" to view the htop settings menu.

To view the list of processes in the htop tree view , press " F5" or " t" . ▼

To view the list of processes in the htop tree view, press "F5" or "t". 

Change htop refresh interval

To change the refresh interval for htop output, use the -d command line option.

"htop -dx" (x means refreshed in seconds)▼

htop -d 10

Detailed explanation of HTOP shortcut keys and function keys

The following is the command description diagram of the shortcut keys and function keys of the HTOP monitoring tool ▼

Command diagram of HTOP monitoring tool shortcut keys and function keys

Comment

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

Scroll to Top