How to Hide Kernel Threads in htop on Ubuntu
This guide explains how to configure the htop process viewer to hide kernel threads by default on Ubuntu. By modifying the htop configuration file, you can reduce clutter in the process list and focus on user-space applications without needing to toggle settings every time you launch the tool.
Edit the htop Configuration File
To set this preference permanently, you must modify the
htoprc configuration file located in your home directory.
Ensure that htop is not currently running before making these changes to
prevent the active session from overwriting your edits upon exit.
Open your terminal.
Open the configuration file using a text editor like nano:
nano ~/.config/htop/htoprcNote: If this file does not exist, run
htoponce, pressF10to quit, and then try opening the file again.Locate the line that reads
hide_kernel_threads=0.Change the value from
0to1so it looks like this:hide_kernel_threads=1Save the file by pressing
Ctrl + O, then exit nano by pressingCtrl + X.
Verify the Configuration
Launch htop by typing htop in the terminal. The process
list should now exclude kernel threads automatically. If you need to
temporarily view kernel threads, you can press F2 to access
the setup menu, navigate to Display options, and toggle
Hide kernel threads during the session. Press
F10 to save any interactive changes back to the
configuration file.