Skip to main content

Usefull commands

Remove

The most elegant way to remove all exitednon-running containerss

containers

seems to be:

docker rm $(docker ps -q -f status=exited)

docker rm $(docker ps -q -f status=exited)

  • -q prints just the container ids (without column headers)
  • -f allows you to filter your list of printed containers (in this case we are filtering to only show exited containers)