9

Is there a way to have the list of processes in htop only display as the name of the command, rather than the full pathname w/ flags?

5 Answers 5

6

As an update, now apparently there is an option in Setup/DisplayItems Show Program Path that is checked by default. Just need to uncheck that so only the command name is shown.

3

Apparently not. You can however go to Setup/DisplayItems to Highlight the basenames.

It doesn't only list the command like you want, but it atleast makes it a little more visible.

2
  • Ah. The highlighting helps a lot. Thx. Seems sort of dumb to not provide an option for basename-only listings, though -- it's extremely noisy the way it is now.
    – Yewge
    Jan 20, 2010 at 13:51
  • There's a PR in htop github that may help resolving this issue some day: github.com/hishamhm/htop/pull/184 Aug 7, 2015 at 9:59
3

To make htop display only nginx processes:

htop -p $(pgrep nginx | paste -s -d,)
1
  • htop -p $(pgrep nginx | paste -s -d, ) the space before the last closed bracket is important else the command gives an error htop: option requires an argument -- 'p' in my case. Second, the mentioned error occurs, when no process of this name is running at all Feb 1, 2020 at 11:53
2

As an addition to @mfink answer.

When you open htop, press F2, then scroll to Display options, left arrow, scroll down to Show program path and uncheck with space.

enter image description here

1

As an addendum to previous answers, that pointed to F2/Display Options/Show program path.

You can toggle this on/off by pressing p in the main screen of htop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .