Best Answer · By JanBask QA Expert
Answered on Feb 26, 2021
Here is some info that helps you to list the containers in docker
docker ps //To show only running containers
docker ps -a //To show all containers
docker ps -l //To show the latest created container
docker ps -n=-1 //To show n last created containers
docker ps -s //To display total file sizes
In the new version of Docker, commands are updated, and some management commands are added:
docker container ls //To list all the running containers.
docker container ls -a //To clean them all,
docker rm $(docker ps -aq) //To list all the containers created irrespective of its state.