pstree 输出中的括号意味着什么?

pstree 输出中的括号意味着什么?

用于将进程包含在 pstree 输出中的[]{}之间有什么区别 ?[{}]我猜[]是用于指定多个进程。例如,

init-+-NetworkManager-+-dhclient
     |                |-dnsmasq
     |                `-2*[{NetworkManager}]
     |-accounts-daemon---{accounts-daemon}
     |-acpid

...

     |-gnome-terminal-+-7*[bash---emacs]
     |                |-6*[bash]
     |                |-2*[bash---less]
     |                |-bash-+-2*[grep]
     |                |      |-less
     |                |      `-locate
     |                |-bash-+-less
     |                |      `-pstree
     |                |-bash-+-emacs
     |                |      `-okular---2*[{okular}]
     |                |-gnome-pty-helpe
     |                `-3*[{gnome-terminal}]

我只有一个进程从带有和 的okularshell 进程运行。为什么我有?nohup&okular---2*[{okular}]

我不明白有关的联机帮助页

进程的子线程在父进程下找到,并在大括号中显示进程名称,例如

   icecast2---13*[{icecast2}]

答案1

man pstree

pstree  visually  merges  identical  branches by putting them in square
brackets and prefixing them with the repetition count, e.g.

       init-+-getty
            |-getty
            |-getty
            `-getty

becomes

       init---4*[getty]

Child threads of a process are found under the parent process  and  are
shown with the process name in curly braces, e.g.

       icecast2---13*[{icecast2}]
  • []表示相同的分支。
  • {}表示子线程。

n[{process_name}]意味着父进程下有 n 个线程process_name

相关内容