将 htop 锚定到一个特定进程?

bec*_*cko 13 htop

我在 中显示了一长串进程htop,但我只对其中一个感兴趣。随着旧进程终止并产生新进程,htop不断更新显示的进程列表,这意味着我感兴趣的一个进程不断在列表中上下跳跃。

是否可以以某种方式禁用此行为?

也就是说,我想将滚动锚定到这个特定的过程。我怎样才能做到这一点?

Syl*_*eau 26

您不能将给定的流程行锚定到顶部,但htop如果您按Shift+可以跟随流程F。从手册页

   F    "Follow" process: if the sort order causes the currently  selected
        process  to  move  in  the list, make the selection bar follow it.
        This is useful for monitoring a process: this way, you can keep  a
        process  always  visible  on  screen. When a movement key is used,
        "follow" loses effect.
Run Code Online (Sandbox Code Playgroud)

在这里,我正在关注我的 Firefox 流程:

在此处输入图片说明

请注意,如果您只对一个特定进程感兴趣,那么它-p <pid>会执行您想要的操作(12352 是我系统上 Firefox 的 pid):

$ htop -p 12352
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明