← 返回命令列表

Linux command

podman-rm 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Remove container

podman rm [container]

Force remove running container

podman rm -f [container]

Remove multiple containers

podman rm [container1] [container2]

Remove all containers

podman rm -a

Remove container and its anonymous volumes

podman rm -v [container]

Remove containers matching a filter

podman rm --filter status=exited

说明

podman rm removes one or more containers. By default, only stopped containers can be removed. Use --force to remove running containers.

参数

-a, --all
Remove all containers.
--cidfile _file_
Read container ID from file and remove it. Can be specified multiple times.
--depend
Remove selected container and recursively remove all containers that depend on it.
--filter _filter_
Filter containers to remove (e.g., status, label, network, ancestor, name).
-f, --force
Force removal of running and paused containers.
-i, --ignore
Ignore errors when specified containers are not in the container store.
-l, --latest
Use the last created container instead of specifying name or ID.
-t, --time _seconds_
Seconds to wait before forcibly stopping the container (requires --force). Use -1 for infinite wait.
-v, --volumes
Remove anonymous volumes associated with the container.

FAQ

What is the podman-rm command used for?

podman rm removes one or more containers. By default, only stopped containers can be removed. Use --force to remove running containers.

How do I run a basic podman-rm example?

Run `podman rm [container]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in podman-rm?

Remove all containers.