2.37. Docker ps command

发布时间 :2025-10-25 12:31:01 UTC      

Docker 命令大全

docker ps : List containers

2.37.1. Grammar

docker ps [OPTIONS]

OPTIONS description:

  • -a : Displays all containers, including those that are not running.

  • -f : Filter the displayed content based on the criteria.

  • –format : Specifies the template file for the return value.

  • -l : Displays the most recently created container.

  • -n : List the most recently created n containers.

  • –no-trunc : The output is not truncated.

  • -q : Silent mode, showing only the container number.

  • -s : Displays the total file size.

2.37.2. Example

Lists all running container information.

runoob@runoob:~$ docker ps
CONTAINER ID   IMAGE          COMMAND                ...  PORTS                    NAMES
09b93464c2f7   nginx:latest   "nginx -g 'daemon off" ...  80/tcp, 443/tcp          myrunoob
96f7f14e99ab   mysql:5.6      "docker-entrypoint.sh" ...  0.0.0.0:3306->3306/tcp   mymysql

Description of output details:

CONTAINER ID: Container ID.

IMAGE: The mirror image used.

COMMAND: The command that runs when the container is started.

CREATED: The time when the container was created.

STATUS: Container status.

There are 7 states:

  • Created (created)

  • Restarting (restarting)

  • Running (running)

  • Removing (migrating)

  • Paused (pause)

  • Exited (stop)

  • Dead (death)

PORTS: The port information of the container and the connection type used (tcpudp).

NAMES: The container name that is automatically assigned.

Lists the information of the 5 recently created containers.

runoob@runoob:~$ docker ps -n 5
CONTAINER ID        IMAGE               COMMAND                   CREATED
09b93464c2f7        nginx:latest        "nginx -g 'daemon off"    2 days ago   ...
b8573233d675        nginx:latest        "/bin/bash"               2 days ago   ...
b1a0703e41e7        nginx:latest        "nginx -g 'daemon off"    2 days ago   ...
f46fb1dec520        5c6e1090e771        "/bin/sh -c 'set -x \t"   2 days ago   ...
a63b4a5597de        860c279d2fec        "bash"                    2 days ago   ...

Lists all created container ID.

runoob@runoob:~$ docker ps -a -q
09b93464c2f7
b8573233d675
b1a0703e41e7
f46fb1dec520
a63b4a5597de
6a4aa42e947b
de7bb36e7968
43a432b73776
664a8ab1a585
ba52eb632bbd
...

Docker 命令大全

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.