docker ps

List running (or all) Docker containers.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

docker ps lists containers with their ID, image, command, status, and ports. The -a flag includes stopped containers. Combined with format strings, it produces machine-parseable output for automation.

Common flags
FlagMeaning
-a --allShow all containers (not just running)
-q --quietOnly show container IDs
--formatCustom output format template
-f --filterFilter by condition (e.g., status=exited)
Examples
docker psShow running containers · explain & risk-check →
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'Custom table format · explain & risk-check →
docker ps -q -f status=exited | xargs docker rmRemove all stopped containers · explain & risk-check →
docker ps --filter name=nginxFilter containers by name · explain & risk-check →
Pro tip

Use `docker ps --format '{{.Names}}'` to get container names for scripting — far cleaner than parsing default tabular output with awk.

Related
docker logs docker exec docker build
Open the full explainer →More in Docker & Containers

Reference text is hand-written and may be incomplete — check man docker for your version. Test destructive commands on a non-production system first.