首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >括号在pstree的输出中意味着什么?

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

Unix & Linux用户
提问于 2014-07-31 05:57:52
回答 1查看 2.8K关注 0票数 2

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

代码语言:javascript
复制
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}]

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

我不明白关于

进程的子线程在父进程下找到,并以大括号显示进程名。

代码语言:javascript
复制
   icecast2---13*[{icecast2}]
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2014-07-31 05:59:43

来自man pstree

代码语言:javascript
复制
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}]意味着父进程process_name下有n个线程。

票数 6
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/147592

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档