1 PTREE(1) User Commands PTREE(1) 2 3 NAME 4 ptree - print process trees 5 6 SYNOPSIS 7 ptree [-a] [-c] [-z zone] [pid | user]... 8 9 DESCRIPTION 10 The ptree utility prints the process trees containing the specified pids 11 or users, with child processes indented from their respective parent 12 processes. An argument of all digits is taken to be a process-ID, 13 otherwise it is assumed to be a user login name. The default is all 14 processes. 15 16 OPTIONS 17 The following options are supported: 18 19 -a All. Print all processes, including children of process 0. 20 21 -c Contracts. Print process contract memberships in addition to 22 parent-child relationships. See process(4). This option 23 implies the -a option. 24 25 -z zone Zones. Print only processes in the specified zone. Each zone 26 ID can be specified as either a zone name or a numerical zone 27 ID. 28 29 This option is only useful when executed in the global zone. 30 31 OPERANDS 32 The following operands are supported: 33 34 pid Process-id or a list of process-ids. ptree also accepts /proc/nnn 35 as a process-id, so the shell expansion /proc/* can be used to 36 specify all processes in the system. 37 38 user Username or list of usernames. Processes whose effective user IDs 39 match those given are displayed. 40 41 FILES 42 /proc/* process files 43 44 EXIT STATUS 45 The ptree utility exits 0 on success, and >0 if an error occurs. 46 47 EXAMPLES 48 Example 1 Using ptree 49 50 The following example prints the process tree (including children of 51 process 0) for processes which match the command name ssh: 52 53 $ ptree -a `pgrep ssh` 54 1 /sbin/init 55 100909 /usr/lib/ssh/sshd 56 569150 /usr/lib/ssh/sshd 57 569157 /usr/lib/ssh/sshd 58 569159 -ksh 59 569171 bash 60 569173 /bin/ksh 61 569193 bash 62 63 INTERFACE STABILITY 64 Not-an-Interface 65 66 SEE ALSO 67 gcore(1), ldd(1), pargs(1), pgrep(1), pkill(1), plimit(1), pmap(1), 68 ppgsz(1), preap(1), proc(1), ps(1), pwd(1), rlogin(1), time(1), truss(1), 69 wait(1), fcntl(2), fstat(2), setuid(2), dlopen(3C), signal.h(3HEAD), 70 core(4), proc(4), process(4), attributes(5), zones(5) 71 72 illumos January 12, 2019 illumos