DEV Community

Cover image for Remove all exited containers
Adam K Dean
Adam K Dean

Posted on

2

Remove all exited containers

This removes all exited containers.

docker ps -a | grep 'Exited' | awk '{print $1}' | xargs --no-run-if-empty docker rm
Enter fullscreen mode Exit fullscreen mode

Use with care as it will also removed Data Volume Containers.

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free