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
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.
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.
-
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.– YewgeJan 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
To make htop display only nginx processes:
htop -p $(pgrep nginx | paste -s -d,)
-
htop -p $(pgrep nginx | paste -s -d, )
the space before the last closed bracket is important else the command gives an errorhtop: 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
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.
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
.