用于在 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}]
Run Code Online (Sandbox Code Playgroud)
我只有一个okular进程从带有nohup和的 shell 进程运行&。为什么我有okular---2*[{okular}]?
我不明白有关的联机帮助页
进程的子线程位于父进程下,并用花括号中的进程名称显示,例如
icecast2---13*[{icecast2}]
Run Code Online (Sandbox Code Playgroud)
来自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}]
Run Code Online (Sandbox Code Playgroud)
[] 表示相同的分支。{} 表示子线程。所以n[{process_name}]这意味着您在父进程下有 n 个线程process_name。