Let’s Learn About The htop System Monitor

There are any number of tools out there to monitor your system and today we’ll cover the ‘htop’ system monitor. This htop application is a pretty solid application and one that you might want to be familiar with. So, let’s learn about htop…

First, your Linux desktop comes with a system monitor called ‘top‘. This is true for so many distros that we might as well accept it as fact. The top application has been around 40 years at the time of this writing and it stands for ‘Table Of Processes’.

The top application is a task manager and system monitor, allowing you to manage processes while also monitoring system resources. You can learn a lot from top, such as uptime, RAM use, CPU use, the number of running processes, and so much more…

top:

If you want,  you can open top with the following command:

(You can just press Q to exit top.)

The output should look a little like this:

An example of top running in the terminal.
This is the top application, which you may already be familiar with…

The man page describes the top application as:

top – display Linux processes

The man page for the top command will also explain that you can do the following with it, which you may find interesting.

As you can see, top is pretty versatile. 

So then, what is htop?

htop:

The name is htop simply because the author’s name is Hisham. It is otherwise similar to the top application but comes with some great benefits. Another great benefit is that htop is going to almost certainly be available for your distro. Some distros have started installing htop by default.

Why htop instead of top?

Well, for starters the layout is much nicer. You can also use your mouse to control htop. This includes scrolling, making it easy to navigate. You can kill processes like this, change their nice value, and more. Additionally, you can even kill multiple processes at the same time.

You can filter and search easily with htop, meaning you can narrow down the results and keep it easier to read. On top of that, htop has a cascading tree layout for the processes. 

I’m told that htop is quicker due in part to how it gathers the information but I have no way to verify this. Both applications seem reasonably quick to me, but that’s what they tell me. I believe this has something to do with being ncurses-based. 

You’ll also click the setup option and configure htop to your needs. It has a nice colorful layout that is quite intuitive. Filtering is also easy, as is searching. Those both come in handy when you want to kill some processes all at once.

If you’re curious, htop looks like this:

running htop in the Linux terminal
It’s more colorful and easier to navigate with a mouse – but you don’t need a mouse to control it.

There are times when you can’t access your GUI system monitor to clear out frozen processes or things like that. So, you should get used to either top or htop. I think you’ll find htop is more featureful and useful in modern times. Even if you can’t use a mouse at the time (say you’re in a TTY), htop is still easy to operate, which is nice.

Install htop:

As I mentioned above, some distros (like Ubuntu) now include htop by default. There are older versions of Ubuntu out there that are still supported, so I’ll include htop installation instructions for them. Then again, they’d be the same instructions used by Debian, so it wouldn’t be that hard to figure out.

For simplicity’s sake, let’s install htop with the terminal. That’s a fairly universal thing. Most of the time, you can open your terminal by pressing CTRL + ALT + T. Otherwise, you’ll find a terminal option in your application menu.

With your terminal open, use the correct command for your package manager:

Debian/Ubuntu/etc:

SUSE/OpenSUSE/etc:

Fedora/etc:

Rocky/Alma/etc:

Arch/Manjaro/etc:

One of those should work for you.

The syntax to use htop is just this:

There aren’t a bunch of flags to worry about, but it’s worth checking the man page:

If you’re going to learn anything from the man page, you might want to learn the keyboard shortcuts for when you do need to use htop without a mouse. There are many, but learning the basics will take you ten minutes. I’d call that ten minutes that were properly invested because htop is a great application.

There you have it.

You should now have htop installed and know how to run the application. I think you’ll like it more than you liked top. I know I do. It’s definitely what I prefer of the two – but it’s not the only option.

Closure:

I’ve wanted to write this article for a while but just didn’t want the hassle of writing it. I finally had both time and motivation, so I wrote the article. There’s some chance that a major storm is going to take out my internet, so I might as well leave you with a good article to keep you going. Now you know about htop, a top replacement. That’s a good thing.

Seriously, I prefer htop over top. It’s just much nicer and easier to work with. Be sure to check the setup options because you can configure htop to your liking. That’s a handy feature to have.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Monitor Your Linux System With NMON

There are times when you want to see what’s going on with your devices and you can monitor your Linux system with nmon. If you’ve never heard of nmon, that’s okay. You’ll find that nmon is a handy application that lets you monitor all sorts of aspects of your system. You’ll also find that nmon is an application that’s used in the terminal, so be prepared for that.

This nmon application is available for most Linux systems and I’ll let you know how to install nmon in this article. You’ll find that nmon stands for ‘Nigel’s Monitor’ and has been around since the early IBM AIX days. It has since been made available for Linux.

You can read about nmon on Wikipedia.
You can also visit the nmon project page.

If you check the man page, you’ll see nmon described as:

nmon – systems administrator, tuner, benchmark tool.

We won’t be doing much of that. We’ll just be using nmon to monitor the system. You can then take that information and use it to administrate, tune, and benchmark the system. We’ll be using nmon to monitor CPU, RAM, your network usage, and things of that nature.

You can also learn more about nmon from the man page because I’ll only be covering how to monitor your Linux system with nmon. There’s almost always so much more! It’s almost a shame that I try to limit many of my articles.

Installing nmon:

You can use your usual GUI tools to find and install nmon. It’ll be available for most distros. It’s also possible to install nmon in the terminal. We’ll cover that, so just press CTRL + ALT + T to open up your terminal.

With your terminal now open, we’re ready to install nmon.

Debian/Ubuntu/etc:

Arch/Mandrake:

RHEL/CentOS:

SUSE/OpenSUSE:

Gentoo:

I think that covers the vast majority of distros out there. If you don’t see your distro, or if I got one wrong, please let me know in the comments. I don’t always get this section right. I wasn’t even planning on writing this article today. But… Here we are!

Monitor Your Linux System With NMON:

You should have a terminal open already, from when you were installing nmon. This is going to sound strange, but you’re new to nmon – or you probably wouldn’t be reading this article. Because you’re new, open up a second terminal.

In the first terminal, enter this:

In the second terminal, enter this:

Now, do you see why I had you open two terminals?

In the first terminal, look at your settings and options. In your second terminal, apply them. See, once you apply them you can no longer trivially refer to the material in the first terminal.

You can apply the monitoring options in any order you’d like and in any combination that you like. The nmon application makes it easy. You press c to monitor the CPU, m to monitor memory, n to monitor the network, and things like that.

So, pick what you want to monitor from the first terminal and press the appropriate key in the second terminal. It might look a bit like this:

nmon monitoring options
There are quite a few options to pick from and it’s straightforward.

Then, your monitoring terminal could look a bit like this:

monitoring system processes with nmon
See? That’s monitoring CPU, memory, the network, and top processes – all in one screen.

Of course, once you know how nmon works and what you’d like to monitor in your Linux system, you won’t need to have the first terminal open. There are a lot of options, but you’ll find they’re easy to remember. You can also use ? instead of a separate terminal window. I find the two-terminal method to be easier for me because I don’t run nmon often enough to recollect the myriad options.

I suppose you want to know how to get out of nmon without closing the terminal window and leaving nmon running in the background. Well, that’s easy. Just press CTRL + C to quit nmon and return to your regular terminal prompt.

Closure: 

I didn’t plan on writing this article today, but I’d cracked open nmon for one reason or another and decided that I’d write about nmon when I was thinking about it. It’s another one of those articles that scratches my own itch, but it’s also something worth sharing.

It’s a pretty easy task to monitor your Linux system with nmon. I figure anyone can do it and I tried to make it easier for new nmon users by suggesting they use two distinct terminal windows. It seems like a reasonable way to get started.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.