For example:
USER PID TTY TIME COMMAND tchrist 9341 p3 1:02 -tcsh tchrist 10423 p3 0:11 vi pt.pl tchrist 27045 p3 0:00 vi pt tchrist 28371 p3 0:04 trn tchrist 29366 p3 0:00 /bin/sh -c Pnews -h /mnt/tchris tchrist 29367 p3 0:00 sh /usr/local/bin/Pnews -h /m tchrist 29394 p3 0:00 perl sigspell tchrist 29395 p3 0:00 vi /mnt/tchrist/.article tchrist 29080 p3 0:01 vi pt.1 tchrist 29831 p3 0:00 sh -c ./pt tchrist 29833 p3 0:00 perl ./pt tchrist 29834 p3 0:00 /bin/ps xlww tchrist 9361 p3 0:08 monthd -i5 tchrist 9500 pb 0:30 -tcsh tchrist 23345 pb 0:18 perl plum tchrist 29726 pb 0:00 perl now-what tchrist 29729 pb 0:00 perl sigspell tchrist 29734 pb 0:00 vi /mnt/tchrist/Mail/drafts tchrist 9522 p3 23:59 perl newsclip 07/02/92 09:15 tchrist 9527 p3 0:07 perl pmeter tchrist 19660 q9 0:47 perl sigrand
The first listed process is the shell, and all those indented under it are its direct children. Thus Pnews is a child of trn, which itself has several children of its own.
Normally, pt will truncate at the width of your screen. The -w option will allow output as wide as ps returns.
To list all processes, use the -a option, even if your system expects to pass ps something other than an a flag; pt should know to pass the appropriate flag to ps.
You can also pass pt a list of pids to restrict output to those process trees contains those pids. Any processes below the named pids will be listed in full. Those above will be listed only if they are direct ancestors. For example (reading this output in from the editor):
:r!pt $$ USER PID TTY TIME COMMAND root 0 ? 0:00 swapout root 1 ? 1:53 init root 9339 ? 8:26 xterm -display 130.168.190.14:0 tchrist 9341 p3 1:02 -tcsh tchrist 29080 p3 0:05 vi pt.1 tchrist 731 p3 0:00 sh -c ./pt $$ tchrist 732 p3 0:00 perl ./pt 731 tchrist 733 p3 0:02 /bin/ps axlww
This allows you to trace both parents and children of a given process.
``ps exited badly! '' ps returned a non-zero exit status.
``couldn't parse getopts.pl: %s
''
``couldn't do getopts.pl: %s
''
``couldn't run getopts.pl: %s
''
All these mean the getopts library couldn't be loaded.
An appropriate message should be printed.
``Didn't you run Configure? '' You are running a raw version of pt that hasn't been configured yet.
``can't fork: %s at line %d of pt
''
pt
was unable to fork a child of itself
to run
ps
with.
The -d option prints out debugging information which may help you diagnose difficulties you may be encountering.