Thursday, May 17, 2007

Identify Process Hierarchy for an Application

Occasionally, you might want to print out the process hierarchy for an application. This can be done using the ptree command. This command can print out the parent and child processes. Here’s an example of its use using Netscape’s PID.

# ptree -a 532
1 /etc/init -
274 /usr/dt/bin/dtlogin -daemon
292 /usr/dt/bin/dtlogin -daemon
311 /bin/ksh /usr/dt/bin/Xsession
356 /usr/dt/bin/sdt_shell -c unset DT; DISPLAY=:0;
359 -sh -c unset DT; DISPLAY=:0; /usr/dt/bin/dtse
372 /usr/dt/bin/dtsession
379 dtwm
404 /usr/dt/bin/dtexec -open 0 -ttprocid 2.16H6ao 01 371 1289
405 /usr/dt/bin/dtterm
407 /sbin/sh
531 ./netscape
532 ./.netscape.bin -xrm *appDir: /usr/dt/appconfig/n
534 (dns helper)

No comments: