{"id":1108,"date":"2019-04-25T12:17:41","date_gmt":"2019-04-25T04:17:41","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1108"},"modified":"2019-04-28T12:28:26","modified_gmt":"2019-04-28T04:28:26","slug":"pstree","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/pstree","title":{"rendered":"pstree\u547d\u4ee4 – \u4ee5\u6811\u72b6\u56fe\u663e\u793a\u8fdb\u7a0b"},"content":{"rendered":"\n

Linux\u7cfb\u7edf\u4e2dpstree\u547d\u4ee4\u7684\u82f1\u6587\u5168\u79f0\u662f\u201cprocess tree\u201d\uff0c\u5373\u5c06\u6240\u6709\u884c\u7a0b\u4ee5\u6811\u72b6\u56fe\u663e\u793a\uff0c\u6811\u72b6\u56fe\u5c06\u4f1a\u4ee5 pid (\u5982\u679c\u6709\u6307\u5b9a) \u6216\u662f\u4ee5 init \u8fd9\u4e2a\u57fa\u672c\u884c\u7a0b\u4e3a\u6839 (root)\uff0c\u5982\u679c\u6709\u6307\u5b9a\u4f7f\u7528\u8005 id\uff0c\u5219\u6811\u72b6\u56fe\u4f1a\u53ea\u663e\u793a\u8be5\u4f7f\u7528\u8005\u6240\u62e5\u6709\u7684\u884c\u7a0b\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong> pstree [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-a <\/td>\u663e\u793a\u6bcf\u4e2a\u7a0b\u5e8f\u7684\u5b8c\u6574\u6307\u4ee4\uff0c\u5305\u542b\u8def\u5f84\uff0c\u53c2\u6570\u6216\u662f\u5e38\u9a7b\u670d\u52a1\u7684\u6807\u793a<\/td><\/tr>
-c <\/td>\u4e0d\u4f7f\u7528\u7cbe\u7b80\u6807\u793a\u6cd5<\/td><\/tr>
-G<\/td>\u4f7f\u7528VT100\u7ec8\u7aef\u673a\u7684\u5217\u7ed8\u56fe\u5b57\u7b26<\/td><\/tr>
-h<\/td>\u5217\u51fa\u6811\u72b6\u56fe\u65f6\uff0c\u7279\u522b\u6807\u660e\u73b0\u5728\u6267\u884c\u7684\u7a0b\u5e8f<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u5f53\u524d\u6240\u6709\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\u548c\u8fdb\u7a0bid\uff1a<\/a><\/p>\n\n\n\n

[root@linuxcool ~]# pstree -p<\/pre>\n\n\n\n

\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u6240\u6709\u8be6\u7ec6\u4fe1\u606f\uff0c\u9047\u5230\u76f8\u540c\u7684\u8fdb\u7a0b\u540d\u53ef\u4ee5\u538b\u7f29\u663e\u793a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# pstree  -a<\/pre>\n","protected":false},"excerpt":{"rendered":"

Linux\u7cfb\u7edf\u4e2dpstree\u547d\u4ee4\u7684\u82f1\u6587\u5168\u79f0\u662f\u201cprocess tree\u201d\uff0c\u5373\u5c06\u6240\u6709\u884c\u7a0b\u4ee5\u6811\u72b6\u56fe\u663e\u793a\uff0c\u6811\u72b6\u56fe\u5c06\u4f1a […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1108"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1108"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1108\/revisions"}],"predecessor-version":[{"id":1548,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1108\/revisions\/1548"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}