How to Show Kernel Threads in htop?

The htop interactive process viewer for Linux hides kernel threads by default to keep the process list clean and readable. However, when debugging system performance or analyzing driver behavior, displaying these threads becomes necessary. This article provides a quick, step-by-step guide on how to toggle the visibility of kernel threads using both keyboard shortcuts and the graphical setup menu within htop.

Method 1: The Quick Keyboard Shortcut

The fastest way to toggle kernel threads on and off is by using a direct keyboard shortcut while htop is actively running.

Pressing this key combination will instantly insert the kernel threads into your process list (usually distinguished by a different color, such as green, depending on your color scheme). Pressing Shift + K a second time will hide them again.

Method 2: Using the Setup Menu

If you prefer navigating the menus or want to verify the setting visually, you can toggle kernel threads through the configuration screen.

  1. Launch htop in your terminal.
  2. Press F2 (or S) to enter the Setup menu.
  3. Use the arrow keys to navigate down to the Display options column.
  4. Press the right arrow key to move into the options list.
  5. Scroll down to the option labeled “Hide kernel threads”.
  6. Press the Spacebar to uncheck the box (which will show the threads).
  7. Press F10 (or Esc) to save your changes and return to the main window.

How to Tell the Difference

Once enabled, kernel threads can be easily identified in the process list. They typically appear wrapped in axis brackets or Ames-style brackets, such as [kthreadd] or [kworker/0:1H], and they do not consume standard user memory space.