How to Display Process Names Only (Without Full Path) in htop: A Linux Process Monitoring Guide


6 views

When monitoring processes in htop, you'll notice it displays the complete command line including full paths and parameters by default. For example, you might see:

/usr/bin/python3 /home/user/app/server.py --port=8080
/usr/lib/firefox/firefox --new-window

This can make the process list unnecessarily wide and harder to scan quickly.

htop provides configuration options to change how process information is displayed:

  1. Press F2 to enter setup mode
  2. Navigate to Display Options
  3. Select Show custom thread names
  4. Toggle Hide userland process threads if needed
  5. Press F10 to save

You can also launch htop with specific display settings:

htop --show-thread-names --hide-userland-threads

For persistent configuration, create or edit ~/.config/htop/htoprc:

# Sample htoprc configuration
hide_userland_threads=1
show_thread_names=1
tree_view=0

For more control, you can customize exactly which columns appear:

1. Press F2 → Columns
2. Remove unnecessary columns
3. Add "Command" (without path) 
4. Set it as the first column
5. Press F10 to save

After configuration, your process list should appear cleaner:

python3
firefox
htop

By default, htop shows processes with their full command line, including paths and arguments. This can make the display cluttered when you're only interested in the process names themselves. For example:

/usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 1

When troubleshooting or monitoring, you often just need to see the clean process name (in this case "firefox").

htop offers several display customization options through its setup menu (F2). To modify how processes are displayed:

  1. Press F2 to enter setup
  2. Navigate to "Display options"
  3. Select "Show custom thread names"
  4. Choose "Command line" and modify the display format

For a persistent solution, you can modify htop's configuration file:

# Create or edit ~/.config/htop/htoprc
# Add these lines:
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=0
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
show_program_path=0
highlight_base_name=1

The key setting here is show_program_path=0 which hides full paths.

If you prefer command-line alternatives:

ps -eo comm | sort | uniq

Or for more detailed but still clean output:

ps -eo pid,comm,pcpu,pmem --sort=-pcpu | head

This configuration is particularly useful when:

  • Monitoring system resource usage by application
  • Troubleshooting conflicting processes
  • Creating clean dashboards for system monitoring
  • Writing scripts that parse process information