ptree(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

ptree(1)

ptree(1)                         User Commands                        ptree(1)

NAME
       ptree - print process trees

SYNOPSIS
       /usr/bin/ptree [-a] [-c] [-z zone] [pid | user]...

DESCRIPTION
       The  ptree  utility  prints  the process trees containing the specified
       pids or users, with child processes indented from their respective par‐
       ent 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.

OPTIONS
       The following options are supported:

       -a         All. Print all processes,  including  system  processes  and
                  init (PID 1).


       -c         Contracts. Print process contract memberships in addition to
                  parent-child  relationships. See process(5). This option im‐
                  plies the -a option.


       -z zone    Zones. Print only processes in the specified zone. Each zone
                  ID can be specified as either a zone  name  or  a  numerical
                  zone ID.

                  This option is only useful when executed in the global zone.
                  See also the -g option.


       -g         Global.  In conjuction with -z  zone, the output is extended
                  to list the global zone direct parents of processes  in  the
                  zone.  Processes from the global zone are marked with an as‐
                  terisk.


       -?         Print usage message and immediately exit.
       --help


OPERANDS
       The following operands are supported:

       pid     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.


       user    Username or list of usernames. Processes whose  effective  user
               IDs match those given are displayed.


EXAMPLES
       Example 1 Using ptree on a specific process



       The  following  example  prints the process tree (including children of
       process 0) for processes which match the command name ssh:


         $ ptree -a 'pgrep ssh'
                 1     /usr/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


       Example 2 Using ptree listing processes inside a zone and direct parent
       processes



       The following command prints the  process  in  the  zone  ngz  and  the
       process  in the global zone which are the parents of the process in the
       zone:


         $ ptree -g -z ngz
           762 zsched
             820 /usr/sbin/init
           829 /lib/svc/bin/svc.startd
            1579 /usr/sbin/ttymon -g -d /dev/console -l console -m ldterm,ttcompat -h -p
           831 /lib/svc/bin/svc.configd
         ....
          1629* zlogin ngz
            1630  <defunct>
          4546* zlogin ngz
            4547 /usr/bin/login -z global -f root
              4548 -bash


EXIT STATUS
       The following exit values are returned:

       0           Successful operation.


       non-zero    An error has occurred.


FILES
       /proc/*    process files


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilitySee be‐
       low.



       The human readable output is Uncommitted The options are Committed.

SEE ALSO
       gcore(1),  ldd(1),  pargs(1),  pgrep(1),  pkill(1), plimit(1), pmap(1),
       ppgsz(1), preap(1), proc(1), ps(1), pwd(1), time(1), truss(1), wait(1),
       fcntl(2), fstat(2), setuid(2),  dlopen(3C),  signal.h(3HEAD),  core(5),
       proc(5), process(5), attributes(7), zones(7), prstat(8)

HISTORY
       Support for the -g option was added in Oracle Solaris 11.4.66.


       Support  for  the  -?  and  --help  options was added in Oracle Solaris
       11.4.42.


       Support for printing SMF service names, when applicable, as part of the
       contract output from  the  -c  option,  was  added  in  Oracle  Solaris
       11.4.12.


       Support for the -c and -z options was added in Solaris 10 3/05.


       The  ptree command, including support for the -a option, was introduced
       in Solaris 2.5.

Oracle Solaris 11.4               19 Feb 2025                         ptree(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3