I would like to be able to collapse all the trees in the default view of htop. Is there a way to achieve that at once, instead of selecting every tree and hitting F6?
5 Answers
Possible as of 3.1.0 (available in repos since Ubuntu 22.10)
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)
- 376
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)
- 21
I don't know about any option to expand/collapse individual branches in htop's tree view (or any other ncurses-based software¹). I would suggest not to presume things of text-based applications from things you have learned from graphical ones².
You can (only) enable/disable tree based view using F5.
Notes:
I've got somehow used to the different design pattern in text-based (DOS era and ncurses or similar based Unix ones) and graphical applications. This collapse tree thing was, in my eyes, a thing invented in Windows.
I would suggest anyone who want to get used to Unix systems disable their GUI for at least a week and learn things again from the bottom up.
- 5,213
- 52