2016-10-14 18:30:36 -04:00
---
title: "volume ls"
description: "The volume ls command description and usage"
2016-11-03 18:48:30 -04:00
keywords: "volume, list"
2016-10-14 18:30:36 -04:00
---
2015-06-12 09:25:32 -04:00
2016-10-19 13:25:45 -04:00
<!-- This file is maintained within the docker/docker Github
repository at https://github.com/docker/docker/. Make all
pull requests against that repo. If you see this file in
another repository, consider it read-only there, as it will
periodically be overwritten by the definitive file. Pull
requests which include edits to this file in other repositories
will be rejected.
-->
2015-06-12 09:25:32 -04:00
# volume ls
2016-07-07 14:43:18 -04:00
```markdown
Usage: docker volume ls [OPTIONS]
List volumes
Aliases:
ls, list
Options:
2016-08-15 11:39:50 -04:00
-f, --filter value Provide filter values (e.g. 'dangling=true') (default [])
2016-07-07 14:43:18 -04:00
- dangling=< boolean > a volume if referenced or not
- driver=< string > a volume's driver name
2016-08-15 11:39:50 -04:00
- label=< key > or label=< key > =< value >
2016-07-07 14:43:18 -04:00
- name=< string > a volume's name
2016-08-04 08:59:55 -04:00
--format string Pretty-print volumes using a Go template
2016-07-07 14:43:18 -04:00
--help Print usage
-q, --quiet Only display volume names
```
2015-06-12 09:25:32 -04:00
2016-10-18 06:50:11 -04:00
List all the volumes Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering ](#filtering ) section for more information about available filter options.
2015-06-12 09:25:32 -04:00
Example output:
2016-08-15 11:39:50 -04:00
```bash
2016-06-14 18:42:30 -04:00
$ docker volume create rosemary
2016-08-15 11:39:50 -04:00
rosemary
2016-06-14 18:42:30 -04:00
$docker volume create tyler
2016-08-15 11:39:50 -04:00
tyler
$ docker volume ls
DRIVER VOLUME NAME
local rosemary
local tyler
```
2016-03-21 03:39:48 -04:00
## Filtering
The filtering flag (`-f` or `--filter` ) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"` )
The currently supported filters are:
* dangling (boolean - true or false, 0 or 1)
* driver (a volume driver's name)
2016-08-15 11:39:50 -04:00
* label (`label=< key > ` or `label=<key>=<value>` )
2016-03-21 03:39:48 -04:00
* name (a volume's name)
### dangling
The `dangling` filter matches on all volumes not referenced by any containers
2016-08-15 11:39:50 -04:00
```bash
$ docker run -d -v tyler:/tmpwork busybox
f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18
$ docker volume ls -f dangling=true
DRIVER VOLUME NAME
local rosemary
```
2016-03-21 03:39:48 -04:00
### driver
The `driver` filter matches on all or part of a volume's driver name.
The following filter matches all volumes with a driver name containing the `local` string.
2016-08-15 11:39:50 -04:00
```bash
$ docker volume ls -f driver=local
DRIVER VOLUME NAME
local rosemary
local tyler
```
#### Label
The `label` filter matches volumes based on the presence of a `label` alone or
a `label` and a value.
First, let's create some volumes to illustrate this;
```bash
2016-06-14 18:42:30 -04:00
$ docker volume create the-doctor --label is-timelord=yes
2016-08-15 11:39:50 -04:00
the-doctor
2016-06-14 18:42:30 -04:00
$ docker volume create daleks --label is-timelord=no
2016-08-15 11:39:50 -04:00
daleks
```
The following example filter matches volumes with the `is-timelord` label
regardless of its value.
```bash
$ docker volume ls --filter label=is-timelord
2016-10-17 05:25:58 -04:00
DRIVER VOLUME NAME
2016-08-15 11:39:50 -04:00
local daleks
local the-doctor
```
As can be seen in the above example, both volumes with `is-timelord=yes` , and
`is-timelord=no` are returned.
Filtering on both `key` *and* `value` of the label, produces the expected result:
```bash
$ docker volume ls --filter label=is-timelord=yes
2016-10-17 05:25:58 -04:00
DRIVER VOLUME NAME
2016-08-15 11:39:50 -04:00
local the-doctor
```
Specifying multiple label filter produces an "and" search; all conditions
should be met;
```bash
$ docker volume ls --filter label=is-timelord=yes --filter label=is-timelord=no
2016-10-17 05:25:58 -04:00
DRIVER VOLUME NAME
2016-08-15 11:39:50 -04:00
```
2016-02-18 14:52:15 -05:00
2016-03-21 03:39:48 -04:00
### name
The `name` filter matches on all or part of a volume's name.
The following filter matches all volumes with a name containing the `rose` string.
$ docker volume ls -f name=rose
DRIVER VOLUME NAME
local rosemary
2016-08-04 08:59:55 -04:00
## Formatting
The formatting options (`--format`) pretty-prints volumes output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
--------------|------------------------------------------------------------------------------------------
`.Name` | Network name
`.Driver` | Network driver
`.Scope` | Network scope (local, global)
`.Mountpoint` | Whether the network is internal or not.
`.Labels` | All labels assigned to the volume.
`.Label` | Value of a specific label for this volume. For example `{{.Label "project.version"}}`
When using the `--format` option, the `volume ls` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`Name` and `Driver` entries separated by a colon for all volumes:
```bash
$ docker volume ls --format "{{.Name}}: {{.Driver}}"
vol1: local
vol2: local
vol3: local
```
2016-02-18 14:52:15 -05:00
## Related information
* [volume create ](volume_create.md )
* [volume inspect ](volume_inspect.md )
* [volume rm ](volume_rm.md )
2016-10-18 06:50:11 -04:00
* [volume prune ](volume_prune.md )
2016-10-17 12:04:52 -04:00
* [Understand Data Volumes ](https://docs.docker.com/engine/tutorials/dockervolumes/ )