How to View Total Tasks and Threads in htop
This article provides a quick overview of how to locate and interpret
the total number of running tasks and threads within the system header
of the htop interactive process viewer in Linux. You will
learn exactly where these metrics are displayed, how to differentiate
between tasks and threads, and how to configure htop to
customize how this data is presented.
Locating Tasks and Threads in the htop Header
When you launch htop in your terminal, the top section
of the screen displays a comprehensive system header. This header
contains vital resource utilization statistics, such as CPU usage bars,
memory consumption, swap space, and system uptime.
Directly below or alongside the uptime metric, you will find the Tasks row. This specific line breaks down the real-time operational state of your system’s processing load.
A typical htop task readout looks like this:
Tasks: 142, 452 thr; 1 running
Breaking Down the Metrics
- Total Tasks (142): The first number represents the total number of distinct processes currently managed by the Linux kernel.
- Total Threads (452 thr): The second number, explicitly labeled with thr, indicates the total number of individual threads currently spawned across all active processes.
- Running State (1 running): The final number shows how many of these tasks or threads are actively executing on a CPU core at that exact microsecond, as opposed to being in a sleeping, blocked, or zombie state.
Customizing the Header View
If you cannot see the thread count, or if you want to change how
processes and threads are counted in your system header, you can easily
modify this behavior through the htop setup menu.
- Press F2 (or S) to enter the Setup menu.
- Use the arrow keys to navigate to Display options.
- Use the spacebar to toggle the following relevant settings:
- Hide kernel threads: Removes background kernel-level threads from the total count.
- Hide userland process threads: Prevents standard application threads from inflating the total task count, allowing you to focus purely on main process containers.
- Press F10 (or Esc) to save your changes and return to the main dashboard.