Post #2129002
2026-04-27 01:54 UTC
podman ps is great and all, but sometimes you don't want the full output, only two columns (like container name and ports).
podman ps --format "{{.Names}} {{.Ports}}" does that, but it's very messy because you have to format it yourself and names and ports are separated by a space, whose column position in the line is almost never the same. Using \t to split by tab will cause the spacing to be different between word lengths.
So...
podman ps --format "{{.Names}} {{.Ports}}" | column --table --separator ' '
This will output the container names + spacing + port + [spacing] + [port] + [spacing] + [port] + [spacing] + [port].
[ ] = only if it exists
#Podman
Replies (0)
No replies.