github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/docs/reference/commandline/node_ls.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "node ls"
     4  description = "The node ls command description and usage"
     5  keywords = ["node, list"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # node ls
    12  
    13  ```markdown
    14  Usage:  docker node ls [OPTIONS]
    15  
    16  List nodes in the swarm
    17  
    18  Aliases:
    19    ls, list
    20  
    21  Options:
    22    -f, --filter value   Filter output based on conditions provided
    23        --help           Print usage
    24    -q, --quiet          Only display IDs
    25  ```
    26  
    27  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.
    28  
    29  Example output:
    30  
    31  ```bash
    32  $ docker node ls
    33  
    34  ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATUS
    35  1bcef6utixb0l0ca7gxuivsj0    swarm-worker2   Ready   Active
    36  38ciaotwjuritcdtn9npbnkuz    swarm-worker1   Ready   Active
    37  e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
    38  ```
    39  
    40  ## Filtering
    41  
    42  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    43  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    44  
    45  The currently supported filters are:
    46  
    47  * name
    48  * id
    49  * label
    50  
    51  ### name
    52  
    53  The `name` filter matches on all or part of a node name.
    54  
    55  The following filter matches the node with a name equal to `swarm-master` string.
    56  
    57  ```bash
    58  $ docker node ls -f name=swarm-manager1
    59  
    60  ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATUS
    61  e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
    62  ```
    63  
    64  ### id
    65  
    66  The `id` filter matches all or part of a node's id.
    67  
    68  ```bash
    69  $ docker node ls -f id=1
    70  
    71  ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
    72  1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
    73  ```
    74  
    75  #### label
    76  
    77  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    78  value.
    79  
    80  The following filter matches nodes with the `usage` label regardless of its value.
    81  
    82  ```bash
    83  $ docker node ls -f "label=foo"
    84  
    85  ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
    86  1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
    87  ```
    88  
    89  
    90  ## Related information
    91  
    92  * [node inspect](node_inspect.md)
    93  * [node update](node_update.md)
    94  * [node ps](node_ps.md)
    95  * [node rm](node_rm.md)