System process monitoring with Htop

This article deals with system process and resource allocation monitoring. Htop is external tools available for various Linux packages. For demonstration i am using Ubuntu 14.10 as Linux distribution.

Introduction.

Htop is process monitoring tool and alternative for “Top” command for Linux. Top command is used to show the current process and resource allocation of system while Htop does the same but with more features. We recommend Htop for system administrator as well as for developers out there.

In this article i am going to cover as much information i can to help you to make best out of this awesome tool.

Installation.

Installation part is very easy. Open up your terminal and executes following command.
For ubuntu and debian packages:

sudo apt-get install htop

For CentOS/Fedora/Red hat enterprise packages:

sudo yum install htop

Once installation is over, just type htop in terminal and you should see following screen.
Htop linux tool

Using Htop:

Default configuration of htop shows resource utilization ( uses of Ram etc ) on top-left and list of all process on bottom. if you want you can change the screen layouts according to your need by pressing F2 and changing the layout using arrow keys.

Kill process:

You can navigate through processes by arrow keys and best part is you can even kill the process and its tree by pressing F9 ( if you run it as sudo ) also you can prioritize process by pressing F7 or F8 key.

Tree view:

This is another awesome feature of htop. Process used to run in dependency and also there are some threads which run inside process. To know those details tree view helps a lot. Just press F5 and observe the screen.
Screenshot from 2014-12-21 17:48:42

Searching / Filter / Sorting :

Htop allows you to search in the system process and gives you most relevant result. This is interactive so you don’t have to put keyword, hit enter and wait for result. Press F3, type in what you are looking for and it will highlight the found matches.

Filter is one of the feature which i use a lot. You can filter whole process list according to your need. For example most of my time i work around Node.js and i only want to see process related to my node Server. So i filter it like this. Press F4 and type “node server.js”. it shows the result right away.
Screenshot from 2014-12-21 18:00:35

You can sort processes by various parameters such as PID,USER,PRIORITY etc. Press F6 and select the parameter shown on left.
Screenshot from 2014-12-21 17:57:13

You can close the application using F10 key.

Conclusion:

Htop is really one of the best and helpful tool in my knowledge. If you deal with Linux and find Top really annoying to search and kill processes then Htop is the tool you must give a try.

Shahid

Founder of Codeforgeek. Technologist. Published Author. Engineer. Content Creator. Teaching Everything I learn!

Related Posts

1 Comment

  1. Can I integrate htop command to nodejs. How I get the stats from command the same thing can it possible to make in nodejs programmatically.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.