'\" t .nh .TH podman-volume-prune 1 .SH NAME podman-volume-prune \- Remove unused volumes .SH SYNOPSIS \fBpodman volume prune\fP [\fIoptions\fP] .SH DESCRIPTION Remove unused volumes. By default only \fBanonymous\fP (unnamed) unused volumes are removed. Anonymous volumes are those created with a container (e.g. \fBpodman run -v /path\fP without a volume name). Use \fB--all\fP (or \fB-a\fP) to remove all unused volumes, including named ones. .PP The \fB--filter\fP flag can be used to restrict which volumes are considered. Users are prompted to confirm removal unless \fB--force\fP is used. .SH OPTIONS .SS \fB--all\fP, \fB-a\fP Remove all unused volumes (anonymous and named). Without this option, only anonymous unused volumes are removed. .PP \fB--all\fP can be combined with \fB--filter\fP: \fB--all\fP widens the set of candidate volumes to all unused ones, and the filters then restrict which of those are removed. For example, \fB--all --filter label!=keep\fP removes every unused volume that does not have the \fIkeep\fP label. .SS \fB--dry-run\fP Show which volumes would be pruned without removing them. .SS \fB--filter\fP Provide filter values. .PP If there is more than one filter, the \fB--filter\fR option should be passed multiple times: \fB--filter\fP \fIlabel=test\fP \fB--filter\fP \fIuntil=10m\fP\&. .PP Filters with the same key work inclusive, with the only exception being \fBlabel\fR which is exclusive. Filters with different keys always work exclusive. .PP Supported filters: .TS allbox; l l l l . \fBFilter\fP \fBDescription\fP all T{ [Bool] When true, remove all unused volumes (same as \fB--all\fP). When false or unset, only anonymous volumes are considered. T} anonymous T{ [Bool] Only remove volumes that are anonymous (true) or named (false). T} label T{ [String] Only remove volumes, with (or without, in the case of label!=[...] is used) the specified labels. T} label! T{ [String] Only remove volumes without the specified labels. T} until T{ [DateTime] Only remove volumes created before given timestamp. T} after/since T{ [Volume] Filter by volumes created after the given VOLUME (name or tag) T} .TE .PP The \fBlabel\fR \fIfilter\fP accepts two formats. One is the \fBlabel\fR=\fIkey\fP or \fBlabel\fR=\fIkey\fP=\fIvalue\fP, which removes volumes with the specified labels. The other format is the \fBlabel!\fR=\fIkey\fP or \fBlabel!\fR=\fIkey\fP=\fIvalue\fP, which removes volumes without the specified labels. .PP \fBNOTE:\fP \fBlabel!\fR filters are combined with \fBAND\fP, so that the behavior is consistent with \fBlabel\fR, while in Docker, they are combined with \fBOR\fP\&. .PP The \fBuntil\fR \fIfilter\fP can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machine's time. .SS \fB--force\fP, \fB-f\fP Do not prompt for confirmation. .SS \fB--help\fP Print usage statement .SH EXAMPLES Prune only anonymous unused volumes (default). .EX $ podman volume prune .EE .PP Prune only anonymous unused volumes without confirmation. .EX $ podman volume prune --force .EE .PP Prune all unused volumes (anonymous and named). .EX $ podman volume prune --all --force .EE .PP Prune all unused volumes except those with a specific label (combine \fB--all\fP with a filter). .EX $ podman volume prune --all --force --filter label!=keep .EE .PP Prune all unused volumes using the filter (equivalent to \fB--all\fP). .EX $ podman volume prune --filter all=true --force .EE .PP Prune unused volumes that have the specified label. .EX $ podman volume prune --filter label=mylabel=mylabelvalue .EE .PP Prune unused volumes that do NOT have a specific label key/value: .EX $ podman volume prune --filter label!=mylabel=mylabelvalue .EE .PP Prune unused volumes that have a specific label key (regardless of value): .EX $ podman volume prune --filter label=environment .EE .PP Prune unused volumes that do NOT have a specific label key: .EX $ podman volume prune --filter label!=environment .EE .PP Preview all unused volumes without removing them. .EX $ podman volume prune --all --dry-run .EE .SH SEE ALSO \fBpodman(1)\fP, \fBpodman-volume(1)\fP .SH HISTORY November 2018, Originally compiled by Urvashi Mohnani umohnani@redhat.com \[la]mailto:umohnani@redhat.com\[ra]