10

I believe I have read some time ago how you can make top stop sorting the tasks so that they stay in the same line (easier to read) but still get updates for their values (in contrast to simply stopping the screen refresh by pressing e.g. k or r).

Now I tried to find this info in both the online help and the man page but couldn't find anything like that. Of course, it's possible that I have just dreamt reading something like this.

Braiam
  • 35,991
Hauke Laging
  • 90,279
  • 1
    Is using an alternative out of the question? Perhaps htop? – slm Mar 03 '14 at 21:50
  • @slm well how would you do it with htop then? – jterm Jun 28 '16 at 13:05
  • @jterm - if you have a new question I encourage you to ask it as such. You can reference this question in your new one. – slm Jun 28 '16 at 13:11
  • @slm no, it is the exact same question. He said he thought he could do it with top (and it doesnt seem you can). You suggest that it can be done with htop but refuse to say how. – jterm Jun 29 '16 at 15:08
  • shouldn't duplicate be the most recent ? – Archemar Oct 24 '16 at 13:23
  • Like mentioned in https://superuser.com/a/1322922/277471 the keyboard shortcuts to use are ctrl+s to freeze and ctrl+q to stop freeze. – mbigras Jun 18 '21 at 18:18
  • @mbigras That does not keep the sort order but just freezes the console content. That helps if you want to read old data but you don't get updates. – Hauke Laging Jun 19 '21 at 03:21

3 Answers3

4

You can just sort by anything that doesn't change that much, like the process ID ( Fa)

Anthon
  • 79,293
  • But that (probably) collects the wrong tasks in the window (I have two windows thus the space is limited). – Hauke Laging Mar 02 '14 at 16:10
  • The other thing I use 'e' for user name, but that only works if there are a limited number of process for the username and that it is at the extremety of the sorting spectrum (ie. starting with 'a' or with 'z') – Anthon Mar 02 '14 at 16:24
0

Did you try one shot top with

top  -n 1
0

I don't think there's a simple feature like that since intentionally you have to sort the process list somehow - I think by default it's the cpu load - otherwise it would be just a random pick. What you are might looking for is the p (PID monitoring) flag that lets you select the set of processes you're interested in. But even they will be sorted by one or another category.