
{"id":18541,"date":"2009-11-22T15:50:25","date_gmt":"2009-11-22T10:20:25","guid":{"rendered":"http:\/\/froisa.com\/?p=39"},"modified":"2009-11-22T15:50:25","modified_gmt":"2009-11-22T10:20:25","slug":"pstree","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2009\/11\/22\/pstree\/","title":{"rendered":"pstree &#8211; display a tree of processes"},"content":{"rendered":"<p><u>ABOUT pstree<\/u><\/p>\n<pre>\npstree shows running processes as a tree.  The tree is rooted at either pid  or  init  if  pid  is\nomitted.   If a user name is specified, all process trees rooted at processes owned by that user are\nshown.\n<\/pre>\n<p>[bash]<br \/>\n$pstree -A<br \/>\ninit-+-NetworkManager&#8212;3*[{NetworkManager}]<br \/>\n     |-accounts-daemon&#8212;2*[{accounts-daemon}]<br \/>\n     |-acpid<br \/>\n     |-at-spi-bus-laun-+-dbus-daemon<br \/>\n     |                 `-3*[{at-spi-bus-laun}]<br \/>\n     |-at-spi2-registr&#8212;{at-spi2-registr}<br \/>\n     |-atd<br \/>\n     |-avahi-daemon&#8212;avahi-daemon<br \/>\n     |-bluetoothd<br \/>\n     |-colord&#8212;2*[{colord}]<br \/>\n     |-console-kit-dae&#8212;64*[{console-kit-dae}]<br \/>\n     |-cron<br \/>\n     |-2*[dbus-daemon]<br \/>\n     |-dbus-launch<br \/>\n     |-dconf-service&#8212;2*[{dconf-service}]<br \/>\n     |-dhclient<br \/>\n     |-evolution-addre&#8212;4*[{evolution-addre}]<br \/>\n     |-evolution-calen&#8212;4*[{evolution-calen}]<br \/>\n     |-evolution-sourc&#8212;2*[{evolution-sourc}]<br \/>\n     |-exim4<br \/>\n     |-gconfd-2<br \/>\n     |-gdm3-+-gdm-simple-slav-+-Xorg&#8212;{Xorg}<br \/>\n     |      |                 |-gdm-session-wor-+-gnome-session-+-applet.py&#8212;{applet.py}<br \/>\n     |      |                 |                 |               |-evolution-alarm&#8212;4*[{evolution-alarm}]<br \/>\n     |      |                 |                 |               |-gnome-settings&#8212;-3*[{gnome-settings-}]<br \/>\n     |      |                 |                 |               |-gnome-shell-+-chrome-+-chrome<br \/>\n     |      |                 |                 |               |             |        |-chrome-sandbox&#8212;chro+<br \/>\n     |      |                 |                 |               |             |        `-39*[{chrome}]<br \/>\n     |      |                 |                 |               |             `-6*[{gnome-shell}]<br \/>\n     |      |                 |                 |               |-ssh-agent<br \/>\n     |      |                 |                 |               |-tracker-store&#8212;7*[{tracker-store}]<br \/>\n     |      |                 |                 |               `-3*[{gnome-session}]<br \/>\n     |      |                 |                 `-2*[{gdm-session-wor}]<br \/>\n     |      |                 `-2*[{gdm-simple-slav}]<br \/>\n     |      `-2*[{gdm3}]<br \/>\n     |-6*[getty]<br \/>\n     |-gnome-keyring-d&#8212;7*[{gnome-keyring-d}]<br \/>\n     |-gnome-shell-cal&#8212;4*[{gnome-shell-cal}]<br \/>\n     |-gnome-terminal&#8211;+-bash&#8212;emacs<br \/>\n     |                 |-bash&#8212;pstree<br \/>\n     |                 |-gnome-pty-helpe<br \/>\n     |                 `-3*[{gnome-terminal-}]<br \/>\n     |-goa-daemon&#8212;3*[{goa-daemon}]<br \/>\n     |-gpm<br \/>\n     |-gsd-printer&#8212;{gsd-printer}<br \/>\n     |-gvfs-afc-volume&#8212;2*[{gvfs-afc-volume}]<br \/>\n     |-gvfs-goa-volume&#8212;{gvfs-goa-volume}<br \/>\n     |-gvfs-gphoto2-vo&#8212;{gvfs-gphoto2-vo}<br \/>\n     |-gvfs-mtp-volume&#8212;{gvfs-mtp-volume}<br \/>\n     |-gvfs-udisks2-vo&#8212;2*[{gvfs-udisks2-vo}]<br \/>\n     |-gvfsd&#8212;{gvfsd}<br \/>\n     |-gvfsd-burn&#8212;2*[{gvfsd-burn}]<br \/>\n     |-mission-control&#8212;2*[{mission-control}]<br \/>\n     |-modem-manager<br \/>\n     |-ntpd<br \/>\n     |-polkitd&#8212;2*[{polkitd}]<br \/>\n     |-pulseaudio&#8212;2*[{pulseaudio}]<br \/>\n     |-rsyslogd&#8212;3*[{rsyslogd}]<br \/>\n     |-rtkit-daemon&#8212;2*[{rtkit-daemon}]<br \/>\n     |-sshd<br \/>\n     |-systemd-logind<br \/>\n     |-udevd<br \/>\n     |-udisksd&#8212;4*[{udisksd}]<br \/>\n     |-upowerd&#8212;2*[{upowerd}]<br \/>\n     `-wpa_supplicant<br \/>\n$<br \/>\n[\/bash]<\/p>\n<pre>\nUNIX Explanation\n\npstree  shows running processes  as a  tree. The  tree is rooted at either pid or init if pid is omitted.\nIf a user name is specified, all  process trees rooted at processes owned by that user are shown.\n<\/pre>\n<p><u>RELATED SOURCE CODE EXPOSITION<\/u><br \/>\n[c]<br \/>\nstatic void free_buffers()<br \/>\n{<br \/>\n    if (width != NULL) {<br \/>\n        free(width);<br \/>\n        width = NULL;<br \/>\n    }<br \/>\n    if (more != NULL) {<br \/>\n        free(more);<br \/>\n        more = NULL;<br \/>\n    }<br \/>\n    capacity = 0;<br \/>\n}<br \/>\n[\/c]<\/p>\n<p><u>SOURCE CODE HIGHLIGHT<\/u><\/p>\n<p>\nFrees any buffers allocated by ensure_buffer_capacity.\n<\/p>\n<p><u>RELATED KNOWLEDGE<\/u><\/p>\n<pre>\nThe   fundamental  data   structure  within   the  kernel controlling all processes is the process\nstructure, which grows and shrinks dynamically as processes are forked and finished or killed.\n<\/pre>\n<p>LINKS<br \/>\n<a href=\"https:\/\/www.howtoforge.com\/linux-pstree-command\/\">https:\/\/www.howtoforge.com\/linux-pstree-command\/<\/a><br \/>\n<a href=\"http:\/\/man7.org\/linux\/man-pages\/man1\/pstree.1.html\">http:\/\/man7.org\/linux\/man-pages\/man1\/pstree.1.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ABOUT pstree 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 processes owned by that user are shown. [bash] $pstree -A init-+-NetworkManager&#8212;3*[{NetworkManager}] |-accounts-daemon&#8212;2*[{accounts-daemon}] |-acpid |-at-spi-bus-laun-+-dbus-daemon | `-3*[{at-spi-bus-laun}] |-at-spi2-registr&#8212;{at-spi2-registr} |-atd |-avahi-daemon&#8212;avahi-daemon |-bluetoothd |-colord&#8212;2*[{colord}] |-console-kit-dae&#8212;64*[{console-kit-dae}] &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2009\/11\/22\/pstree\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;pstree &#8211; display a tree of processes&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":18246,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[639,1301,1322],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18541"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=18541"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18541\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=18541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=18541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=18541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}