Monday, February 13, 2017

How to display tree of processes on Ubuntu


Another cool thing you can do while you are on command line is displaying tree of processes, how cool is that? This is very useful for someone who wants to trace processes on ubuntu, you actually get the visual display of every processes.

We can use the pstree command to display tree of processes on ubuntu, and don't worry about installing it, because most likely the pstree command already installed on your ubuntu, so you just can run it.

How to display tree of processes on ubuntu
pstree
Here's example output of pstree command:
init─┬─ModemManager───2*[{ModemManager}]
     ├─NetworkManager───3*[{NetworkManager}]
     ├─accounts-daemon───2*[{accounts-daemon}]
     ├─acpid
     ├─avahi-daemon───avahi-daemon
     ├─beanstalkd
     ├─bluetoothd
     ├─colord───2*[{colord}]
     ├─console-kit-dae───64*[{console-kit-dae}]
     ├─cron
     ├─cups-browsed
     ├─cupsd───dbus
     ├─daemon───java───36*[{java}]
     ├─dbus-daemon
     ├─dhclient
     ├─docker───5*[{docker}]
     ├─6*[getty]
     ├─gnome-keyring-d───6*[{gnome-keyring-d}]
     ├─irqbalance
     ├─java───59*[{java}]
     ├─kerneloops
     ├─lightdm─┬─Xorg
     │         ├─lightdm─┬─init─┬─/usr/bin/x-term─┬─bash───sudo───su───bash
     │         │         │      │                 ├─bash
     │         │         │      │                 ├─bash───ssh
     │         │         │      │                 ├─bash───man───pager
     │         │         │      │                 ├─gnome-pty-helpe
     │         │         │      │                 └─3*[{/usr/bin/x-term}]
     │         │         │      ├─/usr/bin/x-term─┬─bash───pstree
     │         │         │      │                 ├─gnome-pty-helpe
     │         │         │      │                 └─4*[{/usr/bin/x-term}]
     │         │         │      ├─at-spi-bus-laun─┬─dbus-daemon
     │         │         │      │                 └─3*[{at-spi-bus-laun}]
     │         │         │      ├─at-spi2-registr───{at-spi2-registr}
     │         │         │      ├─bamfdaemon───3*[{bamfdaemon}]
     ├─nmbd
     ├─osspd───11*[{osspd}]
     ├─php5-fpm───2*[php5-fpm]
     ├─polkitd───2*[{polkitd}]
     ├─redis-server───2*[{redis-server}]
     ├─rsyslogd───3*[{rsyslogd}]
     ├─rtkit-daemon───2*[{rtkit-daemon}]
     ├─smbd───2*[smbd]
     ├─sshd
     ├─systemd-logind
     ├─systemd-udevd
     ├─udisksd───4*[{udisksd}]
     ├─upowerd───2*[{upowerd}]
     ├─upstart-file-br
     ├─upstart-socket-
     ├─upstart-udev-br
     ├─vsftpd
     ├─whoopsie───2*[{whoopsie}]
     └─winbindd───winbindd


No comments:

Post a Comment