List unhealthy Docker containers with their health output
Build a paste-ready command, then review its compatibility and effects before running it.
docker ps --filter health=unhealthy --format '{{.ID}}\t{{.Names}}\t{{.Status}}'read-onlyno known side effects Compatibility
Linux + macOS + WindowsVerified for Linux, macOS, Windows using bash, zsh, powershell syntax.
Operational knowledgereview due 2027-01-19
Requirementsdockerdocker must be installed and available on PATH.
Version supportdocker Current supported releasesVerified for linux, macos, windows using bash, zsh, powershell syntax; consult compatibility notes for platform-specific differences.
Expected signals9f36c8a22d14 payments-api Up 18 minutes (unhealthy)Representative successful output; values vary with the selected target and system state.
Known errorsdocker: command not founddocker is missing or is not available on PATH.
Verifydocker ps --filter health=unhealthy --format '{{.ID}}\t{{.Names}}\t{{.Status}}'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01dockerCommandRuns the docker stage of this one-liner.
02psArgumentPasses ps to docker.
03--filterOptionRestricts results using the supplied filter expression.
04health=unhealthyArgumentPasses health=unhealthy to docker.
05--formatOptionFormats each result using the supplied template.
06'{{.ID}}\t{{.Names}}\t{{.Status}}'ArgumentPasses '{{.ID}}\t{{.Names}}\t{{.Status}}' to docker.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
docker ps --filter health=unhealthy --format '{{.ID}}\t{{.Names}}\t{{.Status}}'
Example output
9f36c8a22d14 payments-api Up 18 minutes (unhealthy)
2bb73ab842f1 worker Up 7 minutes (unhealthy)
Illustrative output — exact values vary by system and data.
Official sources