ptree - print process trees
/usr/bin/ptree [-a] [-c] [-s svc] [-z zone] [pid | user]...
The ptree utility prints the process trees containing the specified
pids or users, 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
The following options are supported:
All. Print all processes, including children of process
Contracts. Print process contract memberships and their
associated SMF FMRIs, in addition to parent-child relationships. See
process(4). This option implies the -a option.
Print only processes with an SMF service FMRI matching
the argument. The FMRI may be in truncated form (such as 'console-login').
This includes child processes even if they are not members of the service
contract. See process(4).
The following operands are supported:
Zones. Print only processes in the specified zone
Each zone ID
can be specified as either a zone name or a numerical zone
This option is only useful when executed in the global zone.
Process-id or a list of process-ids. ptree also
accepts /proc/nnn as a process-id, so the shell expansion
/proc/* can be used to specify all processes in the system.
Username or list of usernames. Processes whose effective
user IDs match those given are displayed.
Example 1 Using ptree
The following example prints the process tree (including children
of process 0) for processes which match the command name ssh:
$ ptree -a `pgrep ssh`
The following exit values are returned:
An error has occurred.
See attributes(5) for descriptions of the following attributes:
The human readable output is Unstable. The options are
gcore(1), ldd(1), pargs(1), pgrep(1),
pkill(1), plimit(1), pmap(1), preap(1),
proc(1), ps(1), ppgsz(1), pwd(1),
rlogin(1), time(1), truss(1), wait(1),
fcntl(2), fstat(2), setuid(2), dlopen(3C),
signal.h(3HEAD), core(4), proc(4), process(4),