2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PTREE 1 "Oct 11, 2005"
8 ptree \- print process trees
12 \fB/usr/bin/ptree\fR [\fB-a\fR] [\fB-c\fR] [\fB-z\fR \fIzone\fR] [\fIpid\fR | \fIuser\fR]...
18 The \fBptree\fR utility prints the process trees containing the specified
19 \fIpid\fRs or \fIuser\fRs, with child processes indented from their respective
20 parent processes. An argument of all digits is taken to be a process-ID,
21 otherwise it is assumed to be a user login name. The default is all processes.
25 The following options are supported:
32 All. Print all processes, including children of process 0.
41 Contracts. Print process contract memberships in addition to parent-child
42 relationships. See \fBprocess\fR(4). This option implies the \fB-a\fR option.
48 \fB\fB-z\fR \fIzone\fR\fR
51 Zones. Print only processes in the specified \fIzone\fR. Each zone \fBID\fR can
52 be specified as either a zone name or a numerical zone \fBID\fR.
54 This option is only useful when executed in the global zone.
60 The following operands are supported:
67 Process-id or a list of process-ids. \fBptree\fR also accepts
68 \fB/proc/\fR\fInnn\fR as a process-id, so the shell expansion \fB/proc/*\fR can
69 be used to specify all processes in the system.
78 Username or list of usernames. Processes whose effective user IDs match those
84 \fBExample 1 \fRUsing ptree
87 The following example prints the process tree (including children of process 0)
88 for processes which match the command name \fBssh\fR:
93 $ ptree -a `pgrep ssh`
95 100909 /usr/lib/ssh/sshd
96 569150 /usr/lib/ssh/sshd
97 569157 /usr/lib/ssh/sshd
109 The following exit values are returned:
116 Successful operation.
125 An error has occurred.
141 See \fBattributes\fR(5) for descriptions of the following attributes:
149 ATTRIBUTE TYPE ATTRIBUTE VALUE
151 Interface Stability See below.
156 The human readable output is Unstable. The options are Evolving.
160 \fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpgrep\fR(1), \fBpkill\fR(1),
161 \fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1), \fBproc\fR(1), \fBps\fR(1),
162 \fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1), \fBtime\fR(1), \fBtruss\fR(1),
163 \fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBsetuid\fR(2),
164 \fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4), \fBproc\fR(4),
165 \fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5)