description: 'This is a living document of useful commands for maintaining and using Docker, and should function as a handy reference for developers and DevOps engineers.',
This is a living document of useful commands for maintaining and using Docker, and should function as a handy reference for developers and DevOps engineers.
<Image
src={cargoShipImage}
alt="Image of a cargo ship by Ian Taylor on Unsplash"
If you update your Docker container images regularly using something like [watchtower](https://containrrr.dev/watchtower/), you might have dangling images which are out-of-date and no longer associated with some of your running containers.
So why not use `docker image prune` to reclaim that valuable disk space. For example, running this command on my Raspberry Pi shaved off about 9.66Gb of disk usage.
To do this, use `docker restart $(docker ps -q)`, this command instructs Docker to restart all containers using the container ids which are returned from `docker ps -q`.
## Stopping all containers
Need to stop all containers? Simply use `docker stop $(docker ps -q)`. As above, this uses the container ids from `docker ps` to stop each running container.