github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-container-cleanup.1.md (about) 1 % podman-container-cleanup(1) 2 3 ## NAME 4 podman\-container\-cleanup - Cleanup the container's network and mountpoints 5 6 ## SYNOPSIS 7 **podman container cleanup** [*options*] *container* 8 9 ## DESCRIPTION 10 **podman container cleanup** cleans up exited containers by removing all mountpoints and network configuration from the host. The container name or ID can be used. The cleanup command does not remove the containers. Running containers will not be cleaned up. 11 Sometimes container's mount points and network stacks can remain if the podman command was killed or the container ran in daemon mode. This command is automatically executed when you run containers in daemon mode by the conmon process when the container exits. 12 13 ## OPTIONS 14 15 #### **--all**, **-a** 16 17 Cleanup all containers. 18 19 #### **--exec**=_session_ 20 21 Clean up an exec session for a single container. 22 Can only be specified if a single container is being cleaned up (conflicts with **--all** as such). 23 If **--rm** is not specified, temporary files for the exec session will be cleaned up; if it is, the exec session will be removed from the container. 24 Conflicts with **--rmi** as the container is not being cleaned up so the image cannot be removed. 25 26 #### **--latest**, **-l** 27 Instead of providing the container name or ID, use the last created container. If you use methods other than Podman 28 to run containers such as CRI-O, the last started container could be from either of those methods. 29 30 The latest option is not supported on the remote client. 31 32 #### **--rm** 33 34 After cleanup, remove the container entirely. 35 36 #### **--rmi** 37 38 After cleanup, remove the image entirely. 39 40 ## EXAMPLE 41 42 `podman container cleanup mywebserver` 43 44 `podman container cleanup mywebserver myflaskserver 860a4b23` 45 46 `podman container cleanup 860a4b23` 47 48 `podman container cleanup -a` 49 50 `podman container cleanup --latest` 51 52 ## SEE ALSO 53 podman(1), podman-container(1) 54 55 ## HISTORY 56 Jun 2018, Originally compiled by Dan Walsh <dwalsh@redhat.com>