github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/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      Usage: docker volume ls [OPTIONS]
    14  
    15      List volumes
    16  
    17        -f, --filter=[]      Filter output based on these conditions:
    18                             - dangling=<boolean> a volume if referenced or not
    19                             - driver=<string> a volume's driver name
    20                             - name=<string> a volume's name
    21        --help               Print usage
    22        -q, --quiet          Only display volume names
    23  
    24  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.
    25  
    26  Example output:
    27  
    28      $ docker volume create --name rosemary
    29      rosemary
    30      $docker volume create --name tyler
    31      tyler
    32      $ docker volume ls
    33      DRIVER              VOLUME NAME
    34      local               rosemary
    35      local               tyler
    36  
    37  ## Filtering
    38  
    39  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    40  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    41  
    42  The currently supported filters are:
    43  
    44  * dangling (boolean - true or false, 0 or 1)
    45  * driver (a volume driver's name)
    46  * name (a volume's name)
    47  
    48  ### dangling
    49  
    50  The `dangling` filter matches on all volumes not referenced by any containers
    51  
    52      $ docker run -d  -v tyler:/tmpwork  busybox
    53      f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18
    54      $ docker volume ls -f dangling=true
    55      DRIVER              VOLUME NAME
    56      local               rosemary
    57  
    58  ### driver
    59  
    60  The `driver` filter matches on all or part of a volume's driver name.
    61  
    62  The following filter matches all volumes with a driver name containing the `local` string.
    63  
    64      $ docker volume ls -f driver=local
    65      DRIVER              VOLUME NAME
    66      local               rosemary
    67      local               tyler
    68  
    69  ### name
    70  
    71  The `name` filter matches on all or part of a volume's name.
    72  
    73  The following filter matches all volumes with a name containing the `rose` string.
    74  
    75      $ docker volume ls -f name=rose
    76      DRIVER              VOLUME NAME
    77      local               rosemary
    78  
    79  ## Related information
    80  
    81  * [volume create](volume_create.md)
    82  * [volume inspect](volume_inspect.md)
    83  * [volume rm](volume_rm.md)
    84  * [Understand Data Volumes](../../userguide/containers/dockervolumes.md)