shell

Hierarchic list of processes

You probably use the ps command a lot, but sometimes there is too much info, and somewhat disordered. It can be easily ordered with the forest option, as the following example shows:

$ ps -e -o pid,args --forest
  PID COMMAND
    2 [kthreadd]
    3  \_ [migration/0]
    4  \_ [ksoftirqd/0]
    5  \_ [watchdog/0]

[...]

    1 /sbin/init
 2742 /sbin/udevd --daemon

[...]

 6307 /usr/sbin/gdm
 6310  \_ /usr/sbin/gdm
 6313      \_ /usr/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
 6514      \_ x-session-manager
 6623          \_ /usr/bin/seahorse-agent --execute x-session-manager
 6632          \_ gnome-settings-daemon
 6636          |   \_ /usr/bin/pulseaudio --log-target=syslog
 6640          |       \_ /usr/lib/pulseaudio/pulse/gconf-helper
 6654          \_ /bin/sh /usr/bin/compiz --sm-client-id default0
 6720          |   \_ /usr/bin/compiz.real --ignore-desktop-hints --replace --indirect-rendering --sm-client-id default0 core ccp
 6775          |       \_ /bin/sh -c /usr/bin/compiz-decorator
 6776          |           \_ /bin/sh /usr/bin/compiz-decorator
 6778          |               \_ /usr/bin/gtk-window-decorator
 6656          \_ gnome-panel --sm-client-id default1
 6657          \_ nautilus --no-default-window --sm-client-id default2
 6724          \_ update-notifier
 6730          \_ tracker-applet
 6732          \_ trackerd
 6735          \_ python /usr/share/system-config-printer/applet.py
 6737          \_ nm-applet --sm-disable
 6352 /usr/sbin/atd

[...]

The above command shows (as you see) a hierarchic list of processes, with just the PID and COMMAND columns.

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields