nerdexam
Docker

DCA · Question #128

Will this command list all nodes in a swarm cluster from the command line? Solution: 'docker swarm nodes'

The correct answer is B. No. The command docker swarm nodes is not a valid Docker CLI command to list nodes in a Swarm cluster.

Submitted by emma.c· Apr 18, 2026Container Orchestration

Question

Will this command list all nodes in a swarm cluster from the command line? Solution: 'docker swarm nodes'

Options

  • AYes
  • BNo

How the community answered

(34 responses)
  • A
    9% (3)
  • B
    91% (31)

Why each option

The command `docker swarm nodes` is not a valid Docker CLI command to list nodes in a Swarm cluster.

AYes

There is no `docker swarm nodes` command; using this would result in a command not found error from the Docker CLI.

BNoCorrect

The command `docker swarm nodes` is syntactically incorrect; the correct subcommand for managing and listing Swarm nodes is `node`, as in `docker node ls`.

Concept tested: Docker Swarm node listing command syntax

Source: https://docs.docker.com/engine/reference/commandline/node_ls/

Topics

#Docker Swarm#Swarm nodes#CLI commands#Cluster management

Community Discussion

No community discussion yet for this question.

Full DCA Practice