Display details about a PID and its place in the Unix process hierarchy

Unix administrators use "ps -ef" all the time to determine what processes are running and the relationships between them. The information is useful, but often you have to run the command multiple times, and pipe it through grep with various arguments to determine exactly what is going on.

sons uses "ps -ef", so it presents the data you are familiar with, but it shows the chain of ancestors leading from PID 0 (or PID 1 depending on the flavour of Unix) down to your target PID. It clearly displays your target PID's descendants, and their descendants, so that relationships can be understood at a glance.

Click here for sons.zip, which contains:

Filename Size Date Description
sons.c 4 KB 28-Apr-2002 Free source code so you can port it to your OS. Usually compiles with "cc sons.c -o sons".
aix-sons 11 KB 15-Apr-2002 This binary has been compiled and tested on AIX. Just download and rename.
uw-sons 7 KB 15-Apr-2002 This binary has been compiled and tested on UnixWare. Just download and rename.

Example output:


>sons 915014
      root          1          0    0   Jan 27      - 14785:24 /etc/init
      root       9654          1    0   Jan 27      -  0:20 /usr/sbin/srcmstr -r
      root      22746       9654    0   Jan 27      - 154:09 /usr/sbin/inetd
      root     303000      22746    0 08:35:59      -  0:00 telnetd
------------------------------------------------------------------------------
    robink     915014     303000    0 08:36:00 pts/3399  0:00 -ksh
------------------------------------------------------------------------------
->  robink     407220     915014    0 09:10:37 pts/3399  0:00 ksh /home/robink/scripts/test_times
-->  robink    1569904     407220    6 09:10:37 pts/3399  0:00 find . -name ????.trans -exec basename {} ;
-->  robink    3912672     407220    0 09:10:37 pts/3399  0:00 sort -u -o find1
->  robink    2357120     915014    0 09:10:44 pts/3399  0:00 sons