Monitor system resources using Htop command

Linux Administrator’s can’t run even a single day without using Top Command when they are in office because whenever server load is more our fingers automatically type top command in terminal without asking us. Most-of us are not familiar with Htop command because every time we use Top command, but Htop have many of features and options compared to top command. htop is an interactive process viewer for Linux which was developed by Hisham using ncurses library. Alternatively you Monitor system resources using iotop & iostat, SAR commands.

Advantage’s of HTOP command

  • You can use mouse to interact with htop command
  • Scroll the list vertically and horizontally to see all processes which are currently running
  • Use Arrow, page up, page down keys to scroll
  • Htop kill’s process automatically without PID
  • Htop is Very fast

1) Install Htop

Follow the below steps to install Htop in linux. For CentOS/RHEL/Fedora you need to Enable EPEL repository because their official repository doesn’t have Htop package.

# Install Htop on Ubuntu/LinuxMint/Debian #
$ sudo apt-get install htop

# Install Htop on CentOS/RHEL/Fedora 21 & older systems #
# yum install htop

# Install Htop on CentOS/RHEL/Fedora 22 & later systems #
# dnf install htop

2) Htop Output

See the below standard output for Htop command. Htop output can be considered as three parts (Header, Body & Footer).

  • Header : Header shows the CPU usage, Memory usage, Swap usage, Load average and uptime of system.
  • Body : Body shows the list of processes that are currently running.
  • Footer : Footer shows htop menu option.

htop-command-monitor-system-linux-2-1

3) Sorting Htop Output

By default Htop sortes the output by CPU usage. If you want to sort the output with different options like Memory, PID, etc., You can do this by pressing F6 key. I’m going to sort the output by Memory.
htop-command-monitor-system-linux-3a-1
See, now the below output is sorted by Memory.
htop-command-monitor-system-linux-3b-1

4) Tree View

In default view you can see the Parent process in command section. Sometime that’s not enough to find the root causes and you want to see the child processes of a parent process, you can do this by pressing F5 key.
htop-command-monitor-system-linux-4-1

5) How to Kill the process

Just select the process which you want to kill and Press F9 key then you will get option to enter the signal to complete the process. I’m going to kill MySQL process.
htop-command-monitor-system-linux-5-1

6) How to search the process

By Pressing F3 key you will get search prompt at the bottom of the screen. Simply type the item which you want to search then hit Enter. I’m going to search oracle process.
htop-command-monitor-system-linux-6-1

7) Htop Help

By Pressing F1 key, you can see all the htop options and usages.
htop-command-monitor-system-linux-7-1

8) Customize Htop output

By Pressing F2 key you can Customize the Htop output.
htop-command-monitor-system-linux-8-1
Here after i will use Htop, its amazing…You can also give a try…Enjoy the week…)

Prakash Subramanian

Prakash Subramanian is a Linux lover and has 3.5+ years of experience in linux server administration with major Linux distribution such as (RHEL, CentOS, Ubuntu). He is currently working as a Senior L2 Linux Server administrator.

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better