Sorted tree view in htop or alternative?

10,820

Solution 1

Looks like Glances should have what you need:

glances --tree

And then sort using commands m,t, i etc. Full command reference

Solution 2

A 2019 update on this 2014 question that ranked highly when searching for this topic is that htop has this built in now, and in the current version 2.2.0, simply pressing t in the default view generates a process hierarchy.

Solution 3

Not with htop (and probably with any other alternative) as both views are mutually exclusive: either you list processes sorted by memory, or respect the PPID/PID tree view. You can have both at the same time.

Share:
10,820

Related videos on Youtube

bright-star
Author by

bright-star

Updated on September 18, 2022

Comments

  • bright-star
    bright-star over 1 year

    I am running a Debian flavor of Linux, and I use htop to keep track of memory usage, since it is more detailed than top. I can't seem to get it to sort by memory and display process trees at the same time. Is there a way to do this with htop or an alternative?

  • bright-star
    bright-star about 10 years
    Sure, but since there is a hierarchical relationship there, you could aggregate the memory or CPU usage of the tree and then sort on that.
  • karatedog
    karatedog almost 8 years
    On one of my server htop 1.0.1 does indeed lists the processes and their threads in tree view and sorted by CPU% (based on the process cpu%). On my other server, there is htop 1.0.2 and setting sort by CPU% automatically clears the tree view.
  • Aaron J Lang
    Aaron J Lang over 7 years
    To clarify what @TrevorAlexander said, siblings in the tree could be sorted against one another without breaking the tree display
  • pkk
    pkk almost 5 years
    This option was removed last year: github.com/nicolargo/glances/commit/…
  • Sidney de Moraes
    Sidney de Moraes almost 4 years
    I don't think this answers his question since pressing t only changes view to tree but keeps not allowing you to sort at the same time. I'm using version 2.0.2.
  • Nick Korostelev
    Nick Korostelev over 3 years
    did anyone figure out an alternative to this now that even glances can't do it?