Print this page
10270 Convert ptree(1) to mandoc

*** 1,165 **** - '\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. ! .\" 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. ! .\" 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. ! .\" 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] ! .TH PTREE 1 "Oct 11, 2005" ! .SH NAME ! ptree \- print process trees ! .SH SYNOPSIS ! .LP ! .nf ! \fB/usr/bin/ptree\fR [\fB-a\fR] [\fB-c\fR] [\fB-z\fR \fIzone\fR] [\fIpid\fR | \fIuser\fR]... ! .fi ! ! .SH DESCRIPTION ! .sp ! .LP ! The \fBptree\fR utility prints the process trees containing the specified ! \fIpid\fRs or \fIuser\fRs, with child processes indented from their respective ! parent processes. An argument of all digits is taken to be a process-ID, ! otherwise it is assumed to be a user login name. The default is all processes. ! .SH OPTIONS ! .sp ! .LP The following options are supported: ! .sp ! .ne 2 ! .na ! \fB\fB-a\fR\fR ! .ad ! .RS 11n ! All. Print all processes, including children of process 0. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fB-c\fR\fR ! .ad ! .RS 11n ! Contracts. Print process contract memberships in addition to parent-child ! relationships. See \fBprocess\fR(4). This option implies the \fB-a\fR option. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fB-z\fR \fIzone\fR\fR ! .ad ! .RS 11n ! Zones. Print only processes in the specified \fIzone\fR. Each zone \fBID\fR can ! be specified as either a zone name or a numerical zone \fBID\fR. ! .sp This option is only useful when executed in the global zone. ! .RE ! ! .SH OPERANDS ! .sp ! .LP The following operands are supported: ! .sp ! .ne 2 ! .na ! \fB\fIpid\fR\fR ! .ad ! .RS 8n ! Process-id or a list of process-ids. \fBptree\fR also accepts ! \fB/proc/\fR\fInnn\fR as a process-id, so the shell expansion \fB/proc/*\fR can ! be used to specify all processes in the system. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fIuser\fR\fR ! .ad ! .RS 8n ! Username or list of usernames. Processes whose effective user IDs match those given are displayed. ! .RE ! ! .SH EXAMPLES ! .LP ! \fBExample 1 \fRUsing ptree ! .sp ! .LP The following example prints the process tree (including children of process 0) ! for processes which match the command name \fBssh\fR: ! ! .sp ! .in +2 ! .nf $ ptree -a `pgrep ssh` 1 /sbin/init 100909 /usr/lib/ssh/sshd 569150 /usr/lib/ssh/sshd 569157 /usr/lib/ssh/sshd 569159 -ksh 569171 bash 569173 /bin/ksh 569193 bash ! .fi ! .in -2 ! .sp ! ! .SH EXIT STATUS ! .sp ! .LP ! The following exit values are returned: ! .sp ! .ne 2 ! .na ! \fB\fB0\fR\fR ! .ad ! .RS 12n ! Successful operation. ! .RE ! ! .sp ! .ne 2 ! .na ! \fBnon-zero\fR ! .ad ! .RS 12n ! An error has occurred. ! .RE ! ! .SH FILES ! .sp ! .ne 2 ! .na ! \fB\fB/proc/*\fR\fR ! .ad ! .RS 11n ! process files ! .RE ! ! .SH ATTRIBUTES ! .sp ! .LP ! See \fBattributes\fR(5) for descriptions of the following attributes: ! .sp ! ! .sp ! .TS ! box; ! c | c ! l | l . ! ATTRIBUTE TYPE ATTRIBUTE VALUE ! _ ! Interface Stability See below. ! .TE ! ! .sp ! .LP ! The human readable output is Unstable. The options are Evolving. ! .SH SEE ALSO ! .sp ! .LP ! \fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpgrep\fR(1), \fBpkill\fR(1), ! \fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1), \fBproc\fR(1), \fBps\fR(1), ! \fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1), \fBtime\fR(1), \fBtruss\fR(1), ! \fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBsetuid\fR(2), ! \fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4), \fBproc\fR(4), ! \fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5) --- 1,138 ---- .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. ! .\" Copyright 2019, Joyent, Inc. ! .\" ! .\" 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. ! .\" ! .\" 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. ! .\" ! .\" 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] ! .\" ! .Dd January 12, 2019 ! .Dt PTREE 1 ! .Os ! .Sh NAME ! .Nm ptree ! .Nd print process trees ! .Sh SYNOPSIS ! .Nm ! .Op Fl a ! .Op Fl c ! .Op Fl z Ar zone ! .Oo Ar pid | Ar user Oc Ns ... ! .Sh DESCRIPTION ! The ! .Nm ! utility prints the process trees containing the specified ! .Ar pid Ns s ! or ! .Ar user Ns s , ! with child processes indented from their respective parent processes. ! An argument of all digits is taken to be a process-ID, ! otherwise it is assumed to be a user login name. ! The default is all processes. ! .Sh OPTIONS The following options are supported: ! .Bl -tag -width "-z zone" ! .It Fl a ! All. ! Print all processes, including children of process 0. ! .It Fl c ! Contracts. ! Print process contract memberships in addition to parent-child relationships. ! See ! .Xr process 4 . ! This option implies the ! .Fl a ! option. ! .It Fl z Ar zone ! Zones. ! Print only processes in the specified ! .Ar zone . ! Each zone ! .Sy ID ! can be specified as either a zone name or a numerical zone ! .Sy ID . ! .Pp This option is only useful when executed in the global zone. ! .El ! .Sh OPERANDS The following operands are supported: ! .Bl -tag -width "user" ! .It Ar pid ! Process-id or a list of process-ids. ! .Nm ! also accepts ! .Pa /proc/ Ns Em nnn ! as a process-id, so the shell expansion ! .Pa /proc/* ! can be used to specify all processes in the system. ! .It Ar user ! Username or list of usernames. ! Processes whose effective user IDs match those given are displayed. ! .El ! .Sh FILES ! .Bl -tag -width Pa ! .It Pa /proc/* ! process files ! .El ! .Sh EXIT STATUS ! .Ex -std ! .Sh EXAMPLES ! .Bl -inset ! .It Sy Example 1 ! Using ptree ! .Pp The following example prints the process tree (including children of process 0) ! for processes which match the command name ! .Sy ssh : ! .Bd -literal -offset 2n $ ptree -a `pgrep ssh` 1 /sbin/init 100909 /usr/lib/ssh/sshd 569150 /usr/lib/ssh/sshd 569157 /usr/lib/ssh/sshd 569159 -ksh 569171 bash 569173 /bin/ksh 569193 bash ! .Ed ! .El ! .Sh INTERFACE STABILITY ! Not-an-Interface ! .Sh SEE ALSO ! .Xr gcore 1 , ! .Xr ldd 1 , ! .Xr pargs 1 , ! .Xr pgrep 1 , ! .Xr pkill 1 , ! .Xr plimit 1 , ! .Xr pmap 1 , ! .Xr ppgsz 1 , ! .Xr preap 1 , ! .Xr proc 1 , ! .Xr ps 1 , ! .Xr pwd 1 , ! .Xr rlogin 1 , ! .Xr time 1 , ! .Xr truss 1 , ! .Xr wait 1 , ! .Xr fcntl 2 , ! .Xr fstat 2 , ! .Xr setuid 2 , ! .Xr dlopen 3C , ! .Xr signal.h 3HEAD , ! .Xr core 4 , ! .Xr proc 4 , ! .Xr process 4 , ! .Xr attributes 5 , ! .Xr zones 5