github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-top.1.md (about)

     1  % podman-top(1)
     2  
     3  ## NAME
     4  podman\-top - Display the running processes of a container
     5  
     6  ## SYNOPSIS
     7  **podman top** [*options*] *container* [*format-descriptors*]
     8  
     9  **podman container top** [*options*] *container* [*format-descriptors*]
    10  
    11  ## DESCRIPTION
    12  Display the running processes of the container. The *format-descriptors* are ps (1) compatible AIX format descriptors but extended to print additional information, such as the seccomp mode or the effective capabilities of a given process. The descriptors can either be passed as separated arguments or as a single comma-separated argument. Note that you can also specify options and or flags of ps(1); in this case, Podman will fallback to executing ps with the specified arguments and flags in the container.  Please use the "h*" descriptors if you want to extract host-related information.  For instance, `podman top $name hpid huser` to display the PID and user of the processes in the host context.
    13  
    14  ## OPTIONS
    15  
    16  #### **--help**, **-h**
    17  
    18  Print usage statement
    19  
    20  #### **--latest**, **-l**
    21  
    22  Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
    23  to run containers such as CRI-O, the last started container could be from either of those methods.
    24  
    25  The latest option is not supported on the remote client.
    26  
    27  ## FORMAT DESCRIPTORS
    28  
    29  The following descriptors are supported in addition to the AIX format descriptors mentioned in ps (1):
    30  
    31  **args, capbnd, capeff, capinh, capprm, comm, etime, group, hgroup, hpid, huser, label, nice, pcpu, pgid, pid, ppid, rgroup, ruser, seccomp, state, time, tty, user, vsz**
    32  
    33  **capbnd**
    34  
    35    Set of bounding capabilities. See capabilities (7) for more information.
    36  
    37  **capeff**
    38  
    39    Set of effective capabilities. See capabilities (7) for more information.
    40  
    41  **capinh**
    42  
    43    Set of inheritable capabilities. See capabilities (7) for more information.
    44  
    45  **capprm**
    46  
    47    Set of permitted capabilities. See capabilities (7) for more information.
    48  
    49  **hgroup**
    50  
    51    The corresponding effective group of a container process on the host.
    52  
    53  **hpid**
    54  
    55    The corresponding host PID of a container process.
    56  
    57  **huser**
    58  
    59    The corresponding effective user of a container process on the host.
    60  
    61  **label**
    62  
    63    Current security attributes of the process.
    64  
    65  **seccomp**
    66  
    67    Seccomp mode of the process (i.e., disabled, strict or filter). See seccomp (2) for more information.
    68  
    69  **state**
    70  
    71    Process state codes (e.g, **R** for *running*, **S** for *sleeping*). See proc(5) for more information.
    72  
    73  **stime**
    74  
    75    Process start time (e.g, "2019-12-09 10:50:36 +0100 CET).
    76  
    77  ## EXAMPLES
    78  
    79  By default, `podman-top` prints data similar to `ps -ef`:
    80  
    81  ```
    82  $ podman top f5a62a71b07
    83  USER   PID   PPID   %CPU    ELAPSED         TTY     TIME   COMMAND
    84  root   1     0      0.000   20.386825206s   pts/0   0s     sh
    85  root   7     1      0.000   16.386882887s   pts/0   0s     sleep
    86  root   8     1      0.000   11.386886562s   pts/0   0s     vi
    87  ```
    88  
    89  The output can be controlled by specifying format descriptors as arguments after the container:
    90  
    91  ```
    92  $ podman top -l pid seccomp args %C
    93  PID   SECCOMP   COMMAND     %CPU
    94  1     filter    sh          0.000
    95  8     filter    vi /etc/    0.000
    96  ```
    97  
    98  Podman will fallback to executing ps(1) in the container if an unknown descriptor is specified.
    99  
   100  ```
   101  $ podman top -l -- aux
   102  USER   PID   PPID   %CPU    ELAPSED             TTY   TIME   COMMAND
   103  root   1     0      0.000   1h2m12.497061672s   ?     0s     sleep 100000
   104  ```
   105  
   106  ## SEE ALSO
   107  podman(1), ps(1), seccomp(2), proc(5), capabilities(7)
   108  
   109  ## HISTORY
   110  July 2018, Introduce format descriptors by Valentin Rothberg <vrothberg@suse.com>
   111  
   112  December 2017, Originally compiled by Brent Baude <bbaude@redhat.com>