Linux command
podman-ps 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List running containers
podman ps
List all containers
podman ps -a
Show only IDs
podman ps -q
Custom format output
podman ps --format "{{.Names}} {{.Status}}"
Show latest container
podman ps -l
说明
podman ps lists containers managed by Podman, showing container ID, image, command, creation time, status, ports, and names. By default, only running containers are shown; use -a to include stopped containers. The --format option accepts Go templates for custom output formatting. Use -q for just container IDs (useful for scripting), -l for the most recently created container, and -n to limit to the last N containers. Docker ps compatible.
参数
- -a, --all
- Show all containers.
- -q, --quiet
- Only show IDs.
- -l, --latest
- Show latest container.
- --format _FORMAT_
- Output format template.
- -n _N_
- Show last N containers.
- --no-trunc
- Don't truncate output.
FAQ
What is the podman-ps command used for?
podman ps lists containers managed by Podman, showing container ID, image, command, creation time, status, ports, and names. By default, only running containers are shown; use -a to include stopped containers. The --format option accepts Go templates for custom output formatting. Use -q for just container IDs (useful for scripting), -l for the most recently created container, and -n to limit to the last N containers. Docker ps compatible.
How do I run a basic podman-ps example?
Run `podman ps` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in podman-ps?
Show all containers.