Hello guys,
Is there any command to check the all child processes of a process like `ptree`?
ptree is not working in Linux..
Regards,
Raghu
Hello guys,
Is there any command to check the all child processes of a process like `ptree`?
ptree is not working in Linux..
Regards,
Raghu
Could that be pstree?
$ yum whatprovides */pstree
...
psmisc-22.2-7.x86_64 : Utilities for managing processes on your system.
You can try to use the "--forest" flag of the ps command.
For example: Here is an excerpt from the output of
ps -ef --forest that I ran on my Ubuntu system.
root 838 1 0 Jan26 ? 00:00:00 gdm-binary
root 966 838 0 Jan26 ? 00:00:00 \_ /usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
root 1043 966 0 Jan26 tty7 00:00:23 \_ /usr/bin/X :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-pDbgjo/database -nolisten tcp vt7
root 1302 966 0 Jan26 ? 00:00:00 \_ /usr/lib/gdm/gdm-session-worker
test 1788 1302 0 Jan26 ? 00:00:00 \_ gnome-session
test 1822 1788 0 Jan26 ? 00:00:00 \_ /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session
test 1849 1788 0 Jan26 ? 00:00:02 \_ gnome-power-manager
test 1850 1788 0 Jan26 ? 00:00:16 \_ nm-applet --sm-disable
test 1857 1788 0 Jan26 ? 00:00:00 \_ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
test 1859 1788 0 Jan26 ? 00:00:00 \_ bluetooth-applet
test 1860 1788 0 Jan26 ? 00:00:02 \_ gnome-panel
test 1861 1788 0 Jan26 ? 00:00:00 \_ nautilus
test 1862 1788 0 Jan26 ? 00:00:03 \_ metacity --replace
test 2051 1788 0 Jan26 ? 00:00:00 \_ /usr/lib/gnome-disk-utility/gdu-notification-daemon
test 2061 1788 0 Jan26 ? 00:00:00 \_ /usr/lib/evolution/2.28/evolution-alarm-notify
test 2062 1788 0 Jan26 ? 00:00:00 \_ python /usr/share/system-config-printer/applet.py
test 2072 1788 0 Jan26 ? 00:00:06 \_ update-notifier
As you can see, the output shows the hierarchy of the processes, which is what you were interested in.
Unfortunately, the format of the output has been lost on the post, so the inserted output does not demonstrates the hierarchy. The process name part of sons of processes is indented so that it appears more to the right than that of the father.
ps has options which can display the output of processes (and child processes) in tree hierarchy.