github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-pod-ps.1.md.in (about)

     1  % podman-pod-ps 1
     2  
     3  ## NAME
     4  podman\-pod\-ps - Print out information about pods
     5  
     6  ## SYNOPSIS
     7  **podman pod ps** [*options*]
     8  
     9  ## DESCRIPTION
    10  **podman pod ps** lists the pods on the system.
    11  By default it lists:
    12  
    13   * pod ID
    14   * pod name
    15   * the time the pod was created
    16   * number of containers attached to pod
    17   * container ID of the pod infra container
    18   * status of pod as defined by the following table
    19  
    20  |  **Status**  | **Description**                                 |
    21  | ------------ | ------------------------------------------------|
    22  | Created      | No containers running nor stopped               |
    23  | Running      | at least one container is running               |
    24  | Stopped      | At least one container stopped and none running |
    25  | Exited       | All containers stopped in pod                   |
    26  | Dead         | Error retrieving state                          |
    27  
    28  
    29  ## OPTIONS
    30  
    31  #### **--ctr-ids**
    32  
    33  Display the container IDs
    34  
    35  #### **--ctr-names**
    36  
    37  Display the container names
    38  
    39  #### **--ctr-status**
    40  
    41  Display the container statuses
    42  
    43  #### **--filter**, **-f**=*filter*
    44  
    45  Provide filter values.
    46  
    47  The *filters* argument format is of `key=value`. If there is more than one *filter*, then pass multiple OPTIONS: **--filter** *foo=bar* **--filter** *bif=baz*.
    48  
    49  Supported filters:
    50  
    51  | Filter     | Description                                                                                      |
    52  |------------|--------------------------------------------------------------------------------------------------|
    53  | ctr-ids    | Filter by container ID within the pod. (CID prefix match by default; accepts regex)              |
    54  | ctr-names  | Filter by container name within the pod.                                                         |
    55  | ctr-number | Filter by number of containers in the pod.                                                       |
    56  | ctr-status | Filter by container status within the pod.                                                       |
    57  | id         | Filter by pod ID. (Prefix match by default; accepts regex)                                       |
    58  | label      | Filter by container with (or without, in the case of label!=[...] is used) the specified labels. |
    59  | name       | Filter by pod name.                                                                              |
    60  | network    | Filter by network name or full ID of network.                                                    |
    61  | status     | Filter by pod status.                                                                            |
    62  | until      | Filter by pods created before given timestamp.                                                   |
    63  
    64  The `ctr-ids`, `ctr-names`, `id`, `name` filters accept `regex` format.
    65  
    66  The `ctr-status` filter accepts values: `created`, `running`, `paused`, `stopped`, `exited`, `unknown`.
    67  
    68  The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*key*=*value*, which removes containers with the specified labels. The other format is the `label!`=*key* or `label!`=*key*=*value*, which removes containers without the specified labels.
    69  
    70  The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machine’s time.
    71  
    72  The `status` filter accepts values: `stopped`, `running`, `paused`, `exited`, `dead`, `created`, `degraded`.
    73  
    74  #### **--format**=*format*
    75  
    76  Pretty-print containers to JSON or using a Go template
    77  
    78  Valid placeholders for the Go template are listed below:
    79  
    80  | **Placeholder**     | **Description**                                      |
    81  |---------------------|------------------------------------------------------|
    82  | .Cgroup             | Cgroup path of pod                                   |
    83  | .ContainerIds       | Comma-separated list of container IDs in the pod     |
    84  | .ContainerNames     | Comma-separated list of container names in the pod   |
    85  | .ContainerStatuses  | Comma-separated list of container statuses           |
    86  | .Created            | Creation time of pod                                 |
    87  | .ID                 | Container ID                                         |
    88  | .InfraID            | Pod infra container ID                               |
    89  | .Label *string*     | Specified label of the pod                           |
    90  | .Labels ...         | All the labels assigned to the pod                   |
    91  | .Name               | Name of pod                                          |
    92  | .Networks           | Show all networks connected to the infra container   |
    93  | .NumberOfContainers | Show the number of containers attached to pod        |
    94  | .Restarts           | Show the total number of container restarts in a pod |
    95  | .Status             | Status of pod                                        |
    96  
    97  #### **--help**, **-h**
    98  
    99  Print usage statement
   100  
   101  #### **--latest**, **-l**
   102  
   103  Show the latest pod created (all states) (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
   104  
   105  #### **--namespace**, **--ns**
   106  
   107  Display namespace information of the pod
   108  
   109  #### **--no-trunc**
   110  
   111  Do not truncate the output (default *false*).
   112  
   113  @@option noheading
   114  
   115  #### **--quiet**, **-q**
   116  
   117  Print the numeric IDs of the pods only
   118  
   119  #### **--sort**
   120  
   121  Sort by created, ID, name, status, or number of containers
   122  
   123  Default: created
   124  
   125  ## EXAMPLES
   126  
   127  List all running pods.
   128  ```
   129  $ podman pod ps
   130  POD ID         NAME              STATUS    CREATED          INFRA ID       # OF CONTAINERS
   131  00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   1
   132  f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   2
   133  ```
   134  
   135  List all running pods along with container names within the pods.
   136  ```
   137  $ podman pod ps --ctr-names
   138  POD ID         NAME              STATUS    CREATED          INFRA ID       NAMES
   139  00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   loving_archimedes
   140  f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   thirsty_hawking,wizardly_golick
   141  ```
   142  
   143  List all running pods along with status, names and ids.
   144  ```
   145  $ podman pod ps --ctr-status --ctr-names --ctr-ids
   146  POD ID         NAME              STATUS    CREATED          INFRA ID       IDS                         NAMES                             STATUS
   147  00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   ba465ab0a3a4                loving_archimedes                 running
   148  f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   331693bff40a,8e428daeb89e   thirsty_hawking,wizardly_golick   configured,configured
   149  ```
   150  
   151  List all running pods and print ID, Container Names, and cgroups.
   152  ```
   153  $ podman pod ps --format "{{.ID}}  {{.ContainerNames}}  {{.Cgroup}}"
   154  00dfd6fa02c0   loving_archimedes   /libpod_parent
   155  f4df8692e116   thirsty_hawking,wizardly_golick   /libpod_parent
   156  ```
   157  
   158  List all running pods with two containers sorted by pod ID.
   159  ```
   160  $ podman pod ps --sort id --filter ctr-number=2
   161  POD ID         NAME             STATUS    CREATED          INFRA ID       # OF CONTAINERS
   162  f4df8692e116   nifty_torvalds   Created   10 minutes ago   331693bff40a   2
   163  ```
   164  
   165  List all running pods with their container ids.
   166  ```
   167  $ podman pod ps  --ctr-ids
   168  POD ID         NAME              STATUS    CREATED          INFRA ID       IDS
   169  00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   ba465ab0a3a4
   170  f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   331693bff40a,8e428daeb89e
   171  ```
   172  
   173  List all running pods with container ids without truncating IDs.
   174  ```
   175  $ podman pod ps --no-trunc --ctr-ids
   176  POD ID                                                             NAME              STATUS    CREATED          INFRA ID                                                           IDS
   177  00dfd6fa02c0a2daaedfdf8fcecd06f22ad114d46d167d71777224735f701866   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4e15e3539a1e79c32d1213a02b0989371e274f98e0f1ae9de7050   ba465ab0a3a4e15e3539a1e79c32d1213a02b0989371e274f98e0f1ae9de7050
   178  f4df8692e116a3e6d1d62572644ed36ca475d933808cc3c93435c45aa139314b   nifty_torvalds    Created   10 minutes ago   331693bff40a926b6d52b184e116afd15497610c378d5d4c42945dd6e33b75b0   331693bff40a926b6d52b184e116afd15497610c378d5d4c42945dd6e33b75b0,8e428daeb89e69b71e7916a13accfb87d122889442b5c05c2d99cf94a3230e9d
   179  ```
   180  
   181  List all running pods with container names.
   182  ```
   183  $ podman pod ps --ctr-names
   184  POD ID         NAME   STATUS    CREATED        INFRA ID       NAMES
   185  314f4da82d74   hi     Created   17 hours ago   a9f2d2165675   jovial_jackson,hopeful_archimedes,vibrant_ptolemy,heuristic_jennings,keen_raman,hopeful_newton,mystifying_bose,silly_lalande,serene_lichterman ...
   186  ```
   187  
   188  ## pod ps
   189  Print a list of pods
   190  
   191  ## SEE ALSO
   192  **[podman(1)](podman.1.md)**, **[podman-pod(1)](podman-pod.1.md)**
   193  
   194  ## HISTORY
   195  July 2018, Originally compiled by Peter Hunt <pehunt@redhat.com>