github.com/kobeld/docker@v1.12.0-rc1/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  **Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes.
    12  
    13  # node ls
    14  
    15      Usage:  docker node ls [OPTIONS]
    16  
    17      List nodes in the swarm
    18  
    19      Aliases:
    20        ls, list
    21  
    22      Options:
    23        -f, --filter value   Filter output based on conditions provided
    24            --help           Print usage
    25        -q, --quiet          Only display IDs
    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      $ docker node ls
    32      ID              NAME           STATUS  AVAILABILITY     MANAGER STATUS  LEADER
    33      0gac67oclbxq    swarm-master   Ready   Active           Reachable       Yes
    34      0pwvm3ve66q7    swarm-node-02  Ready   Active
    35      15xwihgw71aw *  swarm-node-01  Ready   Active           Reachable
    36  
    37  
    38  ## Filtering
    39  
    40  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    41  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    42  
    43  The currently supported filters are:
    44  
    45  * name
    46  * id
    47  * label
    48  * desired_state
    49  
    50  ### name
    51  
    52  The `name` filter matches on all or part of a tasks's name.
    53  
    54  The following filter matches the node with a name equal to `swarm-master` string.
    55  
    56      $ docker node ls -f name=swarm-master
    57      ID              NAME          STATUS  AVAILABILITY      MANAGER STATUS  LEADER
    58      0gac67oclbxq *  swarm-master  Ready   Active            Reachable       Yes
    59  
    60  ### id
    61  
    62  The `id` filter matches all or part of a node's id.
    63  
    64      $ docker node ls -f id=0
    65      ID              NAME           STATUS  AVAILABILITY     MANAGER STATUS  LEADER
    66      0gac67oclbxq *  swarm-master   Ready   Active           Reachable       Yes
    67      0pwvm3ve66q7    swarm-node-02  Ready   Active
    68  
    69  
    70  #### label
    71  
    72  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    73  value.
    74  
    75  The following filter matches nodes with the `usage` label regardless of its value.
    76  
    77  ```bash
    78  $ docker node ls -f "label=foo"
    79  ID              NAME           STATUS  AVAILABILITY     MANAGER STATUS  LEADER
    80  15xwihgw71aw *  swarm-node-01  Ready   Active           Reachable
    81  ```
    82  
    83  
    84  ## Related information
    85  
    86  * [node inspect](node_inspect.md)
    87  * [node update](node_update.md)
    88  * [node tasks](node_tasks.md)
    89  * [node rm](node_rm.md)