Is there a difference between "docker ps" and "docker container ls"?

Viewed 19896

The documentation of docker ps and docker container ls both says "List containers", but does not mention the other command. Is there a difference between those two commands?

The output looks exactly the same:

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                    NAMES
bbe3d7158eaa        flaskmysqldockerized_web   "python app.py"          5 hours ago         Up 18 seconds       0.0.0.0:8082->5000/tcp   flaskmysqldockerized_web_1
4f7d3f0763ad        mysql                      "docker-entrypoint..."   6 hours ago         Up 18 seconds       0.0.0.0:3307->3306/tcp   flaskmysqldockerized_db_1
2 Answers

docker ps is shorthand that stands for "docker process status", whilst docker container ls is shorthand for the more verbose docker container list.

As the accepted answer explains, there is no difference in how they work, and docker container ls is the 'newer' command, so you should probably prefer it.

Both commands actually only show running containers by default, which makes the first one (docker ps) a little more confusing as that command on its own isn't really showing 'process status'. To see the status of all containers, add the -a option for 'all' (or use --all), e.g.

docker container ls -a

older

docker ps -a or docker container ps -a

Related