Container ls -qa :- will show all the containers stopped as well as running

Copying and pasting from the Mock Exam -2, question as well as answer as per the mock exam

Q> Which command is used to delete the stopped containers?
Ans> docker container prune,docker container rm $(docker container ls -aq)

How can it be
docker ls -aq ==> gives the ID for the running containers as well, so the above option/choice of answer is not correct
Thanks
Joseph John

Thanks for the notice , we will review it.

1 Like

thanks, but still in exam 3 , it has not been changed

Which command is used to delete the stopped containers?
docker container prune ,
**

docker container rm $(docker container ls -aq)

**

Hello @joseph.john,
Kindly check again now docker container prune and docker rm $(docker ps --filter status=exited -q) are the correct answers.

Thanks,
KodeKloud Support