The Computer Oracle

How to collapse all trees in htop?

--------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Island

--

Chapters
00:00 Question
00:24 Accepted answer (Score 7)
01:50 Answer 2 (Score 6)
02:11 Answer 3 (Score 6)
02:25 Answer 4 (Score 2)
02:51 Thank you

--

Full question
https://superuser.com/questions/855016/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #unix #htop

#avk47



ACCEPTED ANSWER

Score 8


Possible as of 3.1.0 (not yet in all distributions)

As of htop --version 3.1.0, you can in fact toggle-collapse all branches of the tree view (F5) using hotkey * (asterisk). The release happened only on 2021-09-21, so most 2022 linux distributions (except those with rolling releases) are about to receive the updated version with their next release.

For example, the Ubuntu package overview for htop shows that

  • ❌ Ubuntu 21.10 (impish) and 22.04 LTS (jammy) both stick to version 3.0.5 and only
  • Ubuntu 22.10 (kinetic) ships with 3.2.1.

And just for completeness sake:

  • Collapsing and expanding invidivual tree nodes was/remains possible using - and +
  • To review all key bindings in your version of htop, simply enter the help screen (? or h or F1)



ANSWER 2

Score 6


AFAIK "t" is the hotkey for expansion and collapsing tree view in htop.




ANSWER 3

Score 6


You can use the * key

This was implemented in version 3.0.5 (2021-01-12)




ANSWER 4

Score 2



It is still not implented. Moreover, F5/F6 were "killed".

Besides, +/- do not work from keypad. As a result, the whole idea of tree-view became useless (as for me it is the only possible way to represent a lot of processes)