What is the difference between the docker ps and container commands?

I use docker-compose to start containers, docker ps-al lists containers that are stopped, and docker container ls lists containers that are running, but containers that start directly run, containers in "running" and "exit" status, can be seen using docker ps-al , and feel confused about these two commands.

I read the document and said that docker ps-al is used to list containers, and docker container is used to manage containers. Is there any difference between the two commands? Why can"t a single command list all containers?

ask the passing boss to explain

Mar.07,2022

difference between docker ps and docker container ls

Docker 1.13 + introduces grouping commands to help organize a bunch of Docker commands. Both orders do the same thing.
if you run docker help and use Docker 1.13 + (including v17.03 +), you will see "Administrative commands" and "commands" in the help text.

Management Commands:
  ...
  container   Manage containers
  image       Manage images
  ...

Commands:
  ...
  ps          List containers
  run         Run a command in a new container
  ...

the full output is much longer, and if you look at the entire list of commands, there are about 40 of them. It is difficult to view the list because these commands are associated with containers, images, networks, volumes, and so on.

Docker realizes that this is not sustainable in the long run, so they add "administrative commands", which help classify all commands and make the commands themselves more consistent.

for example, docker container ls is the new method docker ps. Of course, this requires more typing, but its function is clearer. Again, you can now run docker image ls,docker network ls or docker volume ls. All of these commands are consistent.

Both versions of the command do the same thing. I think in the long run, non-grouping commands such as docker run) will be deprecated or disapproved and replaced by docker container run . There is no indication that this will happen any time soon, but if you are using Docker 1.13 syntax, you should try using the newer syntax. It is more descriptive and consistent.

reference:
https://nickjanetakis.com/blo.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3d189-44717.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3d189-44717.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?