1 PTREE(1)                         User Commands                        PTREE(1)
   2 
   3 
   4 
   5 NAME
   6        ptree - print process trees
   7 
   8 SYNOPSIS
   9        /usr/bin/ptree [-a] [-c] [-s svc] [-z zone] [pid | user]...
  10 
  11 
  12 DESCRIPTION
  13        The ptree utility prints the process trees containing the specified
  14        pids or users, with child processes indented from their respective
  15        parent processes. An argument of all digits is taken to be a process-
  16        ID, otherwise it is assumed to be a user login name. The default is all
  17        processes.
  18 
  19 OPTIONS
  20        The following options are supported:
  21 
  22        -a
  23                   All. Print all processes, including children of process 0.
  24 
  25 
  26        -c
  27                   Contracts. Print process contract memberships and their
  28                   associated SMF FMRIs, in addition to parent-child
  29                   relationships. See process(4).  This option implies the -a
  30                   option.
  31 
  32 
  33        -s svc
  34                   Print only processes with an SMF service FMRI matching the
  35                   argument. The FMRI may be in truncated form (such as
  36                   'console-login'). This includes child processes even if they
  37                   are not members of the service contract.  See process(4).
  38 
  39 
  40        -z zone
  41                   Zones. Print only processes in the specified zone. Each zone
  42                   ID can be specified as either a zone name or a numerical
  43                   zone ID.
  44 
  45                   This option is only useful when executed in the global zone.
  46 
  47 
  48 OPERANDS
  49        The following operands are supported:
  50 
  51        pid
  52                Process-id or a list of process-ids. ptree also accepts
  53                /proc/nnn as a process-id, so the shell expansion /proc/* can
  54                be used to specify all processes in the system.
  55 
  56 
  57        user
  58                Username or list of usernames. Processes whose effective user
  59                IDs match those given are displayed.
  60 
  61 
  62 EXAMPLES
  63        Example 1 Using ptree
  64 
  65 
  66        The following example prints the process tree (including children of
  67        process 0) for processes which match the command name ssh:
  68 
  69 
  70          $ ptree -a `pgrep ssh`
  71                  1     /sbin/init
  72                    100909 /usr/lib/ssh/sshd
  73                      569150 /usr/lib/ssh/sshd
  74                        569157 /usr/lib/ssh/sshd
  75                          569159 -ksh
  76                            569171 bash
  77                              569173 /bin/ksh
  78                                569193 bash
  79 
  80 
  81 
  82 EXIT STATUS
  83        The following exit values are returned:
  84 
  85        0
  86                    Successful operation.
  87 
  88 
  89        non-zero
  90                    An error has occurred.
  91 
  92 
  93 FILES
  94        /proc/*
  95                   process files
  96 
  97 
  98 ATTRIBUTES
  99        See attributes(5) for descriptions of the following attributes:
 100 
 101 
 102 
 103 
 104        +--------------------+-----------------+
 105        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 106        +--------------------+-----------------+
 107        |Interface Stability | See below.      |
 108        +--------------------+-----------------+
 109 
 110 
 111        The human readable output is Unstable. The options are Evolving.
 112 
 113 SEE ALSO
 114        gcore(1), ldd(1), pargs(1), pgrep(1), pkill(1), plimit(1), pmap(1),
 115        preap(1), proc(1), ps(1), ppgsz(1), pwd(1), rlogin(1), time(1),
 116        truss(1), wait(1), fcntl(2), fstat(2), setuid(2), dlopen(3C),
 117        signal.h(3HEAD), core(4), proc(4), process(4), attributes(5), zones(5)
 118 
 119 
 120 
 121                                September 3, 2019                      PTREE(1)