CentOS / RHEL: Install htop An Interactive Text-mode Process Viewer

by on December 17, 2011 · 0 comments· LAST UPDATED December 17, 2013

in , ,

I am a new Linux/CentOS/RHEL sysadmin. How do I install an interactive text-mode process viewer for called htop on CentOS or Red Hat Enterprise Linux 5.x/6.x+ based system using yum command?

You can install htop on CentOS/RHEL/Fedora Linux using EPEL repo. From the man page:

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion time5m

Htop is a free (GPL) ncurses-based process viewer for Linux. It is similar to top, but allows you to scroll vertically and horizontally, so you can see all the processes running on the system, along with their full command lines. Tasks related to processes (killing, renicing) can be done without entering their PIDs.

Install htop on CentOS/RHEL/Red hat Linux using yum

First you need to enable EPEL repo as described here to install atop. Type the following yum command:
# yum install htop
Sample outputs:

Loaded plugins: auto-update-debuginfo, protectbase, rhnplugin, security
This system is receiving updates from RHN Classic or RHN Satellite.
0 packages excluded due to repository protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.1-2.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
============================================================================================
 Package            Arch                 Version                   Repository          Size
============================================================================================
Installing:
 htop               x86_64               1.0.1-2.el6               epel                75 k
 
Transaction Summary
============================================================================================
Install       1 Package(s)
 
Total download size: 75 k
Installed size: 161 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.1-2.el6.x86_64.rpm                                          |  75 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : htop-1.0.1-2.el6.x86_64                                                  1/1
  Verifying  : htop-1.0.1-2.el6.x86_64                                                  1/1
 
Installed:
  htop.x86_64 0:1.0.1-2.el6
 
Complete!
 

How do I use htop program?

Type the following command as root user. The basic syntax is:
# htop
# htop [options]

Sample outputs:

Fig.01: htop in action

Fig.01: htop in action

htop command examples

Here are some conman and useful examples of htop commands:

Delay between data updates, in tenths of seconds

# htop -d 5
# htop --delay=10

How to start htop in monochrome mode i.e. disable colors

# htop -C
# htop --no-color
# htop --no-colour

Show only the process of a given user (say nixcraft or apache user)

# htop -u nixcraft
# htop --user=apache

Display working thread for pagemap memory stats

# htop -p

See htop(1) command man page for more information.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , ,

Previous Faq:

Next Faq: