github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/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  advisory = "rc"
     7  [menu.main]
     8  parent = "smn_cli"
     9  +++
    10  <![end-metadata]-->
    11  
    12  # node ls
    13  
    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  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.
    27  
    28  Example output:
    29  
    30      $ docker node ls
    31      ID                           NAME           MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    32      1bcef6utixb0l0ca7gxuivsj0    swarm-worker2   Accepted    Ready   Active
    33      38ciaotwjuritcdtn9npbnkuz    swarm-worker1   Accepted    Ready   Active
    34      e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Accepted    Ready   Active        Reachable       Yes
    35  
    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  * name
    45  * id
    46  * label
    47  * desired_state
    48  
    49  ### name
    50  
    51  The `name` filter matches on all or part of a node name.
    52  
    53  The following filter matches the node with a name equal to `swarm-master` string.
    54  
    55      $ docker node ls -f name=swarm-manager1
    56      ID                           NAME            MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    57      e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Accepted    Ready   Active        Reachable       Yes
    58  
    59  ### id
    60  
    61  The `id` filter matches all or part of a node's id.
    62  
    63      $ docker node ls -f id=1
    64      ID                         NAME           MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    65      1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Accepted    Ready   Active
    66  
    67  
    68  #### label
    69  
    70  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    71  value.
    72  
    73  The following filter matches nodes with the `usage` label regardless of its value.
    74  
    75  ```bash
    76  $ docker node ls -f "label=foo"
    77  ID                         NAME           MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    78  1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Accepted    Ready   Active
    79  ```
    80  
    81  
    82  ## Related information
    83  
    84  * [node inspect](node_inspect.md)
    85  * [node update](node_update.md)
    86  * [node tasks](node_tasks.md)
    87  * [node rm](node_rm.md)