with the `--rm` flag. To see all containers on the Docker host, including
stopped containers, use `docker ps -a`. You may be surprised how many containers
exist, especially on a development system! A stopped container's writable layers
still take up disk space. To clean this up, you can use the `docker container
prune` command.
```console
$ docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
```
By default, you're prompted to continue. To bypass the prompt, use the `-f` or
`--force` flag.
By default, all stopped containers are removed. You can limit the scope using
the `--filter` flag. For instance, the following command only removes
stopped containers older than 24 hours:
```console
$ docker container prune --filter "until=24h"
```
Other filtering expressions are available. See the
[`docker container prune` reference](/reference/cli/docker/container/prune.md)
for more examples.
## Prune volumes
Volumes can be used by one or more containers, and take up space on the Docker
host. Volumes are never removed automatically, because to do so could destroy
data.
```console
$ docker volume prune
WARNING! This will remove all volumes not used by at least one container.
Are you sure you want to continue? [y/N] y
```
By default, you are prompted to continue. To bypass the prompt, use the `-f` or
`--force` flag.
By default, all unused volumes are removed. You can limit the scope using
the `--filter` flag. For instance, the following command only removes
volumes which aren't labelled with the `keep` label:
```console
$ docker volume prune --filter "label!=keep"
```
Other filtering expressions are available. See the
[`docker volume prune` reference](/reference/cli/docker/volume/prune.md)
for more examples.
## Prune networks
Docker networks don't take up much disk space, but they do create `iptables`
rules, bridge network devices, and routing table entries. To clean these things
up, you can use `docker network prune` to clean up networks which aren't used