Pstree
{{short description|Unix command that shows the running processes as a tree}}
{{more references|date=September 2012}}
{{lowercase|title=pstree}}
pstree is a Linux command that shows the running processes as a tree.{{Cite web |date=2019-10-23 |title=Pstree Command in Linux |url=https://linuxize.com/post/pstree-command-in-linux/ |access-date=2024-12-27 |website=linuxize.com |language=en-us}}{{Cite web |last=James |first=Hayden |date=2023-12-11 |title=pstree command in Linux with examples |url=https://linuxblog.io/pstree-command-in-linux-examples/ |access-date=2024-12-27 |website=LinuxBlog.io |language=en-US}}{{Cite web |date=2020-05-20 |title=pstree Command in Linux with Examples |url=https://www.geeksforgeeks.org/pstree-command-in-linux-with-examples/ |access-date=2024-12-27 |website=GeeksforGeeks |language=en-US}} It is used as a more visual alternative to the ps command. The root of the tree is either init or the process with the given pid. It can also be installed in other Unix systems.
In BSD systems, a similar output is created using ps -d
, in Linux ps axjf
{{Cite web|url=https://linux.die.net/man/1/ps|title=Ps(1): Report snapshot of current processes - Linux man page}} produces similar output.
Examples
pstree pid
user@host ~$ pstree 1066
rsyslogd─┬─{in:imjournal}
└─{rs:main Q:Reg}
pstree username
user@host ~# pstree username
dbus-daemon───{dbus-daemon}
dbus-launch
bash───firefox─┬─6*[{Analysis Helper}]
├─{BgHangManager}
├─{Cache2 I/O}
├─{Compositor}
├─{GMPThread}
├─{Gecko_IOThread}
├─{Hang Monitor}
├─{ImageBridgeChil}
├─{ImageIO}
├─{JS Watchdog}
├─{Link Monitor}
├─{Socket Thread}
├─{SoftwareVsyncTh}
├─{StreamTrans #1}
├─{Timer}
└─{gmain}
See also
References
{{Reflist}}
External links
- [http://psmisc.sourceforge.net/ The psmisc package]
- [http://www.linfo.org/pstree.html The pstree Command] by The Linux Information Project (LINFO)
- [http://gnopstree.sourceforge.net/ Gnome Process Tree]
- [https://github.com/FredHucht/pstree The portable version of pstree on GitHub]
- {{man|1|pstree|ManKier}}
- {{man|1|ptree|Solaris}}
{{Unix commands}}
Category:Unix process- and task-management-related software
{{Unix-stub}}