github.com/kim0/docker@v0.6.2-0.20161130212042-4addda3f07e7/docs/reference/commandline/node_ls.md (about)

     1  ---
     2  title: "node ls"
     3  description: "The node ls command description and usage"
     4  keywords: ["node, list"]
     5  ---
     6  
     7  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # node ls
    17  
    18  ```markdown
    19  Usage:  docker node ls [OPTIONS]
    20  
    21  List nodes in the swarm
    22  
    23  Aliases:
    24    ls, list
    25  
    26  Options:
    27    -f, --filter value   Filter output based on conditions provided
    28        --help           Print usage
    29    -q, --quiet          Only display IDs
    30  ```
    31  
    32  Lists all the nodes that the Docker Swarm manager knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options.
    33  
    34  Example output:
    35  
    36  ```bash
    37  $ docker node ls
    38  
    39  ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATUS
    40  1bcef6utixb0l0ca7gxuivsj0    swarm-worker2   Ready   Active
    41  38ciaotwjuritcdtn9npbnkuz    swarm-worker1   Ready   Active
    42  e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
    43  ```
    44  
    45  ## Filtering
    46  
    47  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    48  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    49  
    50  The currently supported filters are:
    51  
    52  * name
    53  * id
    54  * label
    55  
    56  ### name
    57  
    58  The `name` filter matches on all or part of a node name.
    59  
    60  The following filter matches the node with a name equal to `swarm-master` string.
    61  
    62  ```bash
    63  $ docker node ls -f name=swarm-manager1
    64  
    65  ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATUS
    66  e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
    67  ```
    68  
    69  ### id
    70  
    71  The `id` filter matches all or part of a node's id.
    72  
    73  ```bash
    74  $ docker node ls -f id=1
    75  
    76  ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
    77  1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
    78  ```
    79  
    80  #### label
    81  
    82  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    83  value.
    84  
    85  The following filter matches nodes with the `usage` label regardless of its value.
    86  
    87  ```bash
    88  $ docker node ls -f "label=foo"
    89  
    90  ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
    91  1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
    92  ```
    93  
    94  
    95  ## Related information
    96  
    97  * [node inspect](node_inspect.md)
    98  * [node update](node_update.md)
    99  * [node ps](node_ps.md)
   100  * [node rm](node_rm.md)