Forrest logo
back to the podman tool

podman-ps:tldr:cc17e

podman-ps: Filter containers that mount a specific volume or have a volume mounted in a specific path.
$ podman ps --filter="volume=${path-to-directory}" --format "table ${-ID}\t${-Image}\t${-Names}\t${-Mounts}"
try on your machine

The command podman ps is used to list running containers. Here is how the command you provided works:

  • --filter="volume=${path-to-directory}" filters the containers based on the volumes they have mounted. It will only list containers that have the specified directory path mounted as a volume. The ${path-to-directory} should be replaced with the actual path to the directory you want to filter by.

  • --format "table ${-ID}\t${-Image}\t${-Names}\t${-Mounts}" specifies the format in which the container information should be displayed. The output will be in a table format with columns for the container ID, image name, container name, and the mounts associated with the container. ${-ID}, ${-Image}, ${-Names}, and ${-Mounts} are placeholders for the actual values that will be displayed in the respective columns.

Note that the - character before ID, Image, Names, and Mounts specifies that the value for those columns should be left-aligned in the table. If you want them to be right-aligned, you can use | instead of - in the format string.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the podman tool