github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-container-prune.1.md (about)

     1  % podman-container-prune 1
     2  
     3  ## NAME
     4  podman\-container\-prune - Remove all stopped containers from local storage
     5  
     6  ## SYNOPSIS
     7  **podman container prune** [*options*]
     8  
     9  ## DESCRIPTION
    10  **podman container prune** removes all stopped containers from local storage.
    11  
    12  ## OPTIONS
    13  #### **--filter**=*filters*
    14  
    15  Provide filter values.
    16  
    17  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*.
    18  
    19  Supported filters:
    20  
    21  | Filter | Description                                                                                          |
    22  |:------:|------------------------------------------------------------------------------------------------------|
    23  | label  | Only remove containers, with (or without, in the case of label!=[...] is used) the specified labels. |
    24  | until  | Only remove containers created before given timestamp.                                               |
    25  
    26  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.
    27  
    28  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.
    29  
    30  #### **--force**, **-f**
    31  
    32  Do not provide an interactive prompt for container removal.\
    33  The default is **false**.
    34  
    35  **-h**, **--help**
    36  
    37  Print usage statement.\
    38  The default is **false**.
    39  
    40  ## EXAMPLES
    41  Remove all stopped containers from local storage:
    42  ```
    43  $ podman container prune
    44  WARNING! This will remove all stopped containers.
    45  Are you sure you want to continue? [y/N] y
    46  878392adf2e6c5c9bb1fc19b69d37d2e98c8abf9d539c0bce4b15b46bbcce471
    47  37664467fbe3618bf9479c34393ac29c02696675addf1750f9e346581636cde7
    48  ed0c6468b8e1cb641b4621d1fe30cb477e1fefc5c0bceb66feaf2f7cb50e5962
    49  6ac6c8f0067b7a4682e6b8e18902665b57d1a0e07e885d9abcd382232a543ccd
    50  fff1c5b6c3631746055ec40598ce8ecaa4b82aef122f9e3a85b03b55c0d06c23
    51  602d343cd47e7cb3dfc808282a9900a3e4555747787ec6723bb68cedab8384d5
    52  ```
    53  
    54  Remove all stopped containers from local storage without confirmation:
    55  ```
    56  $ podman container prune -f
    57  878392adf2e6c5c9bb1fc19b69d37d2e98c8abf9d539c0bce4b15b46bbcce471
    58  37664467fbe3618bf9479c34393ac29c02696675addf1750f9e346581636cde7
    59  ed0c6468b8e1cb641b4621d1fe30cb477e1fefc5c0bceb66feaf2f7cb50e5962
    60  6ac6c8f0067b7a4682e6b8e18902665b57d1a0e07e885d9abcd382232a543ccd
    61  fff1c5b6c3631746055ec40598ce8ecaa4b82aef122f9e3a85b03b55c0d06c23
    62  602d343cd47e7cb3dfc808282a9900a3e4555747787ec6723bb68cedab8384d5
    63  ```
    64  
    65  Remove all stopped containers from local storage created before the last 10 minutes:
    66  ```
    67  $ podman container prune --filter until="10m"
    68  WARNING! This will remove all stopped containers.
    69  Are you sure you want to continue? [y/N] y
    70  3d366295e33d8cc612c4d873199bacadd55088d90d17dcafaa9a2d317ad50b4e
    71  ```
    72  
    73  ## SEE ALSO
    74  **[podman(1)](podman.1.md)**, **[podman-ps(1)](podman-ps.1.md)**
    75  
    76  ## HISTORY
    77  December 2018, Originally compiled by Brent Baude <bbaude@redhat.com>\
    78  December 2020, converted filter information from docs.docker.com documentation by Dan Walsh <dwalsh@redhat.com>