Color Bars in htop – What Do They Mean?

htop color output

Have you ever wondered what all the red, green, orange, aqua, and dark blue bars mean in htop? Even if you are not familiar with htop, this article will introduce you to the great Linux task manager and its color key.

Installing htop

If you haven’t installed htop yet, you can install it at the terminal prompt, using apt or yum:

To install htop on your Debian / Apt based Linux distribution (like Ubuntu and Mint), do:

sudo apt install htop

To install htop on your RedHat / Yum based Linux distribution (like RedHat and Fedora), follow these steps:

sudo yum install htop

htop – the great Linux task manager

Many users are familiar with Windows Task Manager. This handy little utility that allows you to kill processes when they are suspended and get a quick overview of your system’s performance in terms of hardware.

But what can we use in Linux? While some versions of Linux may come with their own task manager (like System Monitor in Ubuntu), these tools may not be universal. They can also lack functionality and be unusable from the command line.

Welcome to htop, the full-fledged terminal-based task manager that can also be started in various distros directly from the desktop, eliminating the need to use a terminal.

Full htop output

htop allows you to browse the processes running on the system, sort them in different ways (try clicking on any of the headers to sort by that column, and click again to reverse the sort) , to kill processes if necessary using a variety of kill signals (to do this, select a process to kill, press F9 and select a shutdown signal), and a variety of other monitoring and management features process.

What happens with all the colors?

So far we’ve only had a glimpse of the lower part of the htop GUI: the list of processes and the htop features to handle each process. However, the top part of the htop GUI is where all this information is combined and where we can monitor the performance of our hardware.

If you want to know more about the interpretation of this result, you can consult our Is your Linux system’s memory, processor, or I / O linked? article.

Looking at the bars and statistics for memory (Mem), swap (Swp), and CPU (1 bar per thread) threads, we quickly see that a wide variety of colors are used to provide more detailed information about each component. and its status bar. We see red, green, orange, dark blue and potentially aqua, and there is also a gap between bars of different types. For example, the memory bar is orange, unlike processor threads.

All these colors are much better than the alternative: htop without color code:

htop monochrome output

You can start htop in monochrome mode by calling htop -C (upper case C required, lower case will not work) on the command line.

Put the monochrome output to the side and go back to our nicer, default colorful htop output, what does each of the colors mean?

The color key

The htop color key may seem hard to find! If we go to the htop manual (man htop) there is no information about colors, other than how to turn them off using the -C option discussed earlier. The answer is to press the F1 key which will take us to a small help screen with the color key as well as practical keyboard shortcuts:

Keyboard shortcuts and htop color key

For the CPU thread usage bar, dark blue bars are low priority processes, green bars are normal processes, red bars are kernel time, and (although you can’t see this), aqua color bars are virtualized processes, when present.

A full CPU thread usage bar will be made up of most of these types of processes – after all, your kernel is still running, etc.

Then we can see the memory bar (Mem) – made up of green, dark blue and orange bars.

The green bars indicate the memory used, the blue bars show us the amount allocated to the buffers and finally the orange bars indicate the amount of memory allocated to the cache. It should be noted that buffer and cache can, in part, be thought of as available memory (type free -g on the command line for more detailed analysis output, or free -m if your system has less than 2-3 gigabytes of total memory).

Finally, the swap bar has only one bar color, red, indicating how many swap file, or the swap partition is in use.

Conclusion

Knowing the colors used by htop allows you to better understand the wealth of information provided by htop. This information can often be obtained at a glance at the htop output. Enjoy knowing more about your desktop or server with htop!

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.