Manage your Linux Box with htop
There is one application that I simply must have on every Linux system I install and that’s htop. It doesn’t matter whether it’s a virtual machine or installed on hardware. It doesn’t matter what distribution it is or whether the system is running a GUI Desktop Environment or not, I gotta have htop. It has become such an integral part of my Linux experience that I completely overlooked doing a video or writing about it until now. One of my EzeeLinux clients brought this fact to my attention. I have referred to htop many times in videos but never actually took the time to explain it. Let’s fix that right now.
So what is htop and why should you install it?
Now, htop is a system monitoring program that shows you what’s going on with your computer in a terminal. It is related to an ancient Unix/Linux utility called Top. Go ahead, open a terminal right now and type in “top” and tap the Enter key. The terminal will fill with information and a list of all the running processes will appear and update automatically depending on the percentage of CPU time the process is taking up. Pretty nifty, huh? To exit Top, just press Q. Your terminal will return to a prompt. There are a few commands you can issue to Top while it’s running but they are somewhat less than intuitive. Most average folks don’t even know they are there.
Hisham Muhammad decided to improve on the old trusty top command and make it more humanly readable plus add more intuitive functionality. (The H in htop refers to his first name.) I’ve found that htop is so easy that even casual Linux users can take advantage of it even if they don’t understand everything it does. As you become more familiar with what processes are and how the system manages them, htop’s more advanced features will become more useful to you.
Htop really shines when you find that your system is running slow or you have an application that is misbehaving. Programs that are not working properly tend to suck up an unusual amount of system memory and/or they demand a lot of CPU time. Htop will help you pinpoint them and you can even kill those programs if they become unresponsive in the GUI. Htop will also show you all running services like Compiz or Samba, things you don’t see on the desktop because they run in the background. Killing Compiz will usually cause the system to automatically restart it. This is nice when your desktop freezes up. If you can get to a terminal then you can fix the problem without having to restart the entire system.
Htop will also allow you to adjust process priorities on the fly… Most folks don’t even know you can do that in Linux. See the video for an in-depth explanation of you can make some processes “nicer” to other processes or users on your system.
A big part of the magic of Linux is how much control you have over your computer. Htop is one of those tools that give you the ability to make your hardware and software work the way you want them to. Htop is available on just about every Linux distribution and you should have no problem installing from the repositories.