github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/docs/reference/commandline/volume_ls.md (about) 1 <!--[metadata]> 2 +++ 3 title = "volume ls" 4 description = "The volume ls command description and usage" 5 keywords = ["volume, list"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 # volume ls 12 13 ```markdown 14 Usage: docker volume ls [OPTIONS] 15 16 List volumes 17 18 Aliases: 19 ls, list 20 21 Options: 22 -f, --filter value Provide filter values (i.e. 'dangling=true') (default []) 23 - dangling=<boolean> a volume if referenced or not 24 - driver=<string> a volume's driver name 25 - name=<string> a volume's name 26 --format string Pretty-print volumes using a Go template 27 --help Print usage 28 -q, --quiet Only display volume names 29 ``` 30 31 Lists 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. 32 33 Example output: 34 35 $ docker volume create --name rosemary 36 rosemary 37 $docker volume create --name tyler 38 tyler 39 $ docker volume ls 40 DRIVER VOLUME NAME 41 local rosemary 42 local tyler 43 44 ## Filtering 45 46 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more 47 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) 48 49 The currently supported filters are: 50 51 * dangling (boolean - true or false, 0 or 1) 52 * driver (a volume driver's name) 53 * name (a volume's name) 54 55 ### dangling 56 57 The `dangling` filter matches on all volumes not referenced by any containers 58 59 $ docker run -d -v tyler:/tmpwork busybox 60 f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18 61 $ docker volume ls -f dangling=true 62 DRIVER VOLUME NAME 63 local rosemary 64 65 ### driver 66 67 The `driver` filter matches on all or part of a volume's driver name. 68 69 The following filter matches all volumes with a driver name containing the `local` string. 70 71 $ docker volume ls -f driver=local 72 DRIVER VOLUME NAME 73 local rosemary 74 local tyler 75 76 ### name 77 78 The `name` filter matches on all or part of a volume's name. 79 80 The following filter matches all volumes with a name containing the `rose` string. 81 82 $ docker volume ls -f name=rose 83 DRIVER VOLUME NAME 84 local rosemary 85 86 ## Formatting 87 88 The formatting options (`--format`) pretty-prints volumes output 89 using a Go template. 90 91 Valid placeholders for the Go template are listed below: 92 93 Placeholder | Description 94 --------------|------------------------------------------------------------------------------------------ 95 `.Name` | Network name 96 `.Driver` | Network driver 97 `.Scope` | Network scope (local, global) 98 `.Mountpoint` | Whether the network is internal or not. 99 `.Labels` | All labels assigned to the volume. 100 `.Label` | Value of a specific label for this volume. For example `{{.Label "project.version"}}` 101 102 When using the `--format` option, the `volume ls` command will either 103 output the data exactly as the template declares or, when using the 104 `table` directive, includes column headers as well. 105 106 The following example uses a template without headers and outputs the 107 `Name` and `Driver` entries separated by a colon for all volumes: 108 109 ```bash 110 $ docker volume ls --format "{{.Name}}: {{.Driver}}" 111 vol1: local 112 vol2: local 113 vol3: local 114 ``` 115 116 ## Related information 117 118 * [volume create](volume_create.md) 119 * [volume inspect](volume_inspect.md) 120 * [volume rm](volume_rm.md) 121 * [Understand Data Volumes](../../tutorials/dockervolumes.md)