-bash-3.2$ pstree 27108
Script.sh---java---15*[{java}]
Run Code Online (Sandbox Code Playgroud)
这在这里15*
是什么意思,还有在命令上下文中为[]
&定义的任何含义{}
?
它就在man
页面中:
pstree shows running processes as a tree. The tree is rooted at either pid or init
if pid is omitted. If a user name is specified, all process trees rooted at pro-
cesses owned by that user are shown.
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)
在您的情况下,进程 27108 是由脚本启动的Script.sh
。所述Script.sh
创建了java
这催生另一个15个Java线程进程。
Aps -eLf | grep java | wc -l
应该返回大约 15 的计数。