.\" $Id: ptree.man,v 2.13 2012/08/14 21:14:32 ksb Exp $ .\" by Kevin Braunsdorf and Pete Fritchman .\" $Compile: Display%h .\" $Display: ${groff:-groff} -Tascii -man %f |${PAGER:-less} .\" $Display(*): ${groff:-groff} -T%s -man %f .\" $Install: %b -mDeinstall %o %f && cp %f ${DESTDIR}/usr/local/man/man1/ptree.1 .\" $Deinstall: ${rm-rm} -f ${DESTDIR}/usr/local/man/[cm]a[nt]1/ptree.1* .TH PTREE 1 LOCAL .SH NAME ptree - display a process tree .SH SYNOPSIS .ds PN "ptree \fI\*(PN\fP [\fB\-an\fP] [\fIpids\fP | \fIlogins\fP] .br \fI\*(PN\fP \fB\-h\fP .br \fI\*(PN\fP \fB\-V\fP .SH DESCRIPTION \fIPtree\fP outputs a graph of the given processes with children indented 2 spaces to the right of their immediate parent. By default the graph includes only children of \fBinit\fP (process 1). .PP The output graphs include each of the \fIpids\fP presented, any processes owned by each \fIlogin\fP requested, and any processes which link those back to \fBinit\fP, unless \fB\-n\fP is given. Each process is only output once. .P A \fIpids\fP list of dash (\-) traces to the \fI\*(PN\fP process itself. .SH OPTIONS .TP \fB\-a\fP By default the process tree doesn't include system processes that are peers of \fBinit\fP. This option removes that injunction. .TP \fB\-h\fP Output a brief help message. .TP \fB\-n\fP This option suppresses the trace for each target process's ancestors back towards \fIinit\fP. The output will only contain descendant processes. .TP \fB\-V\fP Output the version of \fI\*(PN\fP running. .SH EXAMPLES .TP \fI\*(PN\fP $$ Display the process tree from this shell up to, but not including, \fBinit\fP. .TP \fI\*(PN\fP \-a $$ Same as above, but include (any peer of) \fIinit\fP as well. .TP \fI\*(PN\fP \-a Show the whole of the process table, other than kernel threads. .TP \fI\*(PN\fP ksb Show all the processes running for the login "ksb". .TP \fI\*(PN\fP \-n `pgrep cron` Graph the the descendants of the running \fIcron\fP(8) daemon. .TP pgrep cron | xapply \-f '\fI\*(PN\fP \-n' \- A better version of the \fIcron\fP spell, as the lack of a running cron doesn't output a graph for the whole system. .TP pgrep cron | xapply \-f \-N 'echo cron is dead%0' '\fI\*(PN\fP \-n' \- Even better, report that cron is dead when that's the case. .SH BUGS None known. .SH AUTHOR Pete Fritchman and Kevin Braunsdorf .br NonPlayer character Guild .br ptree at ksb.npcguild.org.nospam .SH "SEE ALSO" .hlm 0 sh(1), ps(1), pgrep(1), killall(1), xapply(1L), cron(8), pkill(1)