Linux伺服器管理: 系統的進程管理pstree命令

來源:互聯網
上載者:User

標籤:

pstree命令是查看進程樹或者結構的命令

[[email protected]~]#pstree [選項]  需要注意的是不能將 -p和-u同時使用 如果同時使用前者生效後者無效但並不報錯

選項:

-p:  顯示進程的PID

-u:  顯示進程的所屬使用者

 1 [[email protected] opt]# pstree 2 init─┬─abrtd 3      ├─acpid 4      ├─atd 5      ├─auditd───{auditd} 6      ├─automount───4*[{automount}] 7      ├─certmonger 8      ├─crond 9      ├─cupsd10      ├─dbus-daemon───{dbus-daemon}11      ├─hald───hald-runner─┬─hald-addon-acpi12      │                    └─hald-addon-inpu13      ├─master─┬─pickup14      │        └─qmgr15      ├─mcelog16      ├─6*[mingetty]17      ├─rpc.idmapd18      ├─rpc.statd19      ├─rpcbind20      ├─rsyslogd───3*[{rsyslogd}]21      ├─sshd─┬─sshd───bash───pstree22      │      └─sshd───sshd───bash23      └─udevd───2*[udevd]

或者pstree -p

 1 [[email protected] opt]# pstree -p 2 init(1)─┬─abrtd(1582) 3         ├─acpid(1378) 4         ├─atd(1601) 5         ├─auditd(1124)───{auditd}(1125) 6         ├─automount(1454)─┬─{automount}(1455) 7         │                 ├─{automount}(1456) 8         │                 ├─{automount}(1459) 9         │                 └─{automount}(1462)10         ├─certmonger(1614)11         ├─crond(1590)12         ├─cupsd(1353)13         ├─dbus-daemon(1336)───{dbus-daemon}(1339)14         ├─hald(1387)───hald-runner(1388)─┬─hald-addon-acpi(1431)15         │                                └─hald-addon-inpu(1416)16         ├─master(1558)─┬─pickup(2256)17         │              └─qmgr(1572)18         ├─mcelog(1470)19         ├─mingetty(1630)20         ├─mingetty(1632)21         ├─mingetty(1634)22         ├─mingetty(1636)23         ├─mingetty(1638)24         ├─mingetty(1644)25         ├─rpc.idmapd(1241)26         ├─rpc.statd(1209)27         ├─rpcbind(1191)28         ├─rsyslogd(1149)─┬─{rsyslogd}(1150)29         │                ├─{rsyslogd}(1152)30         │                └─{rsyslogd}(1153)31         ├─sshd(1482)─┬─sshd(1647)───bash(1652)───pstree(2649)32         │            └─sshd(2585)───sshd(2589)───bash(2590)33         └─udevd(466)─┬─udevd(1645)34                      └─udevd(1646)

或者pstree -u

 1 [[email protected] opt]# pstree -u 2 init─┬─abrtd 3      ├─acpid 4      ├─atd 5      ├─auditd───{auditd} 6      ├─automount───4*[{automount}] 7      ├─certmonger 8      ├─crond 9      ├─cupsd10      ├─dbus-daemon(dbus)───{dbus-daemon}11      ├─hald(haldaemon)───hald-runner(root)─┬─hald-addon-acpi(haldaemon)12      │                                     └─hald-addon-inpu13      ├─master─┬─pickup(postfix)14      │        └─qmgr(postfix)15      ├─mcelog16      ├─6*[mingetty]17      ├─rpc.idmapd18      ├─rpc.statd(rpcuser)19      ├─rpcbind(rpc)20      ├─rsyslogd───3*[{rsyslogd}]21      ├─sshd─┬─sshd───bash───pstree22      │      └─sshd───sshd(fengtaotao)───bash23      └─udevd───2*[udevd]
View Code

 

Linux伺服器管理: 系統的進程管理pstree命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.