Spend some time checking out the htop tool for viewing processes and system performance and you might just find it extremely handy when you need it. Credit: Canonmark / Getty Images While it’s one of the best tools for examining performance on Linux, htop still requires some explanation before you’ll be ready to take advantage of all the data it displays. It’s an excellent tool, but you need to understand the coloring scheme, how to scroll up and down through the processes displayed, and how to change your view of what’s happening on the system. It may take some time to get used to the type of information shown and be ready to quickly notice performance problems. That, of course, means that you have to know what normal behavior looks like on your system, and this generally requires spending time with the tool on a relatively frequent basis. In other words, use htop when you’re not at all concerned about how your system is performing and you’ll likely be able to make good use of it when you are. You can start htop in a terminal window or after logging in from another system using a tool like PuTTY. The htop display should look something like this: Sandra Henry-Stocker Stretch out the window and you’ll be able to see more details on more processes. The top left shows the number of CPUs/cores on the system and how busy they are. The colors are important, too. The green bars represent user processes, while red bars represent kernel processes. You may see other colors as well. The colors represent: Green – user processes Red – kernel processes Blue – low priority (nice) processes Turquoise – virtualized processes If you ask for help by pressing F1, you’ll see an explanation of the colors along with other information. Sandra Henry-Stocker Next comes memory and swap usage. Notice in the screenshot above that memory is being significantly used, but swap isn’t being used at all. Clearly this system is not very busy since it doesn’t have to swap process data out of memory. The upper right of the display shows you the number of tasks, threads (thr) and kernel threads (kthr). It also shows how many processes are currently running (using the CPU). In this case, there are 2. Sandra Henry-Stocker This portion of the display also shows load averages and uptime. The load averages show how heavily loaded the system has been over the last 1, 5 and 15 minutes. Uptime shows how long the system has been up in hours, minutes and seconds along with days if it’s been up more than a day (e.g., Uptime: 1 day, 20:18:15). The larger portion of the display shows the processes, organized by PID by default. You can scroll up and down to see additional processes using the up and down arrows on your keyboard. Sandra Henry-Stocker The fields displayed include this information for each process: PID – the process ID USER – the individual running the process PRI – process priority NI – the “nice” setting (priority reset by user) VIRT – virtual memory used RES – physical memory used SHR – shared memory used S – the current process state CPU% – the percentage of CPU used MEM% – the percentage of memory used TIME+ – the time the process has used since it started, measured in hundredths of a second (e.g., 2:34.56 means 2 minutes, 34 seconds and 56 hundredths of a second) Command – the command being run To sort the display by CPU usage, press the F6 key and select select PERCENT_CPU. Then hit the enter key to get back to viewing the processes using the new sort order. As you can see, a number of sorting options are available. Sandra Henry-Stocker When you start htop up again, it will start using whatever sort order you last used. Quit htop by typing “q” or by using the F10 key. Wrap-up The htop tool provides a lot of important information on running processes and can be very useful when looking for problems that might slow down the system. Getting comfortable with using it can help you detect problems easily and quickly or verify that system performance is good. Related content how-to How to find files on Linux There are many options you can use to find files on Linux, including searching by file name (or partial name), age, owner, group, size, type and inode number. By Sandra Henry Stocker Jun 24, 2024 8 mins Linux opinion Linux in your car: Red Hat’s milestone collaboration with exida With contributions from Red Hat and critical collaborators, the safety and security of automotive vehicles has reached a new level of reliability. By Sandra Henry Stocker Jun 17, 2024 5 mins Linux how-to How to print from the Linux command line: double-sided, landscape and more There's a lot more to printing from the Linux command line than the lp command. Check out some of the many available options. By Sandra Henry Stocker Jun 11, 2024 6 mins Linux how-to Converting between uppercase and lowercase on the Linux command line Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. By Sandra Henry Stocker Jun 07, 2024 5 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe