github.com/yogeshlonkar/moby@v1.13.2-0.20201203103638-c0b64beaea94/docs/reference/commandline/node_ps.md (about)

     1  ---
     2  title: "node ps"
     3  description: "The node ps command description and usage"
     4  keywords: node, tasks, ps
     5  aliases: ["/engine/reference/commandline/node_tasks/"]
     6  ---
     7  
     8  <!-- This file is maintained within the docker/docker Github
     9       repository at https://github.com/docker/docker/. Make all
    10       pull requests against that repo. If you see this file in
    11       another repository, consider it read-only there, as it will
    12       periodically be overwritten by the definitive file. Pull
    13       requests which include edits to this file in other repositories
    14       will be rejected.
    15  -->
    16  
    17  # node ps
    18  
    19  ```markdown
    20  Usage:  docker node ps [OPTIONS] [NODE...]
    21  
    22  List tasks running on one or more nodes, defaults to current node.
    23  
    24  Options:
    25    -f, --filter value   Filter output based on conditions provided
    26        --help           Print usage
    27        --no-resolve     Do not map IDs to Names
    28        --no-trunc       Do not truncate output
    29  ```
    30  
    31  ## Description
    32  
    33  Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options.
    34  
    35  ## Examples
    36  
    37  ```bash
    38  $ docker node ps swarm-manager1
    39  NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
    40  redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
    41  redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
    42  redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    43  redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    44  redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    45  ```
    46  
    47  ### Filtering
    48  
    49  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    50  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    51  
    52  The currently supported filters are:
    53  
    54  * [name](#name)
    55  * [id](#id)
    56  * [label](#label)
    57  * [desired-state](#desired-state)
    58  
    59  #### name
    60  
    61  The `name` filter matches on all or part of a task's name.
    62  
    63  The following filter matches all tasks with a name containing the `redis` string.
    64  
    65  ```bash
    66  $ docker node ps -f name=redis swarm-manager1
    67  
    68  NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
    69  redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
    70  redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
    71  redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    72  redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    73  redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    74  ```
    75  
    76  #### id
    77  
    78  The `id` filter matches a task's id.
    79  
    80  ```bash
    81  $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
    82  
    83  NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
    84  redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
    85  ```
    86  
    87  #### label
    88  
    89  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    90  value.
    91  
    92  The following filter matches tasks with the `usage` label regardless of its value.
    93  
    94  ```bash
    95  $ docker node ps -f "label=usage"
    96  
    97  NAME                               IMAGE        NODE            DESIRED STATE  CURRENT STATE
    98  redis.6.b465edgho06e318egmgjbqo4o  redis:3.0.6  swarm-manager1  Running        Running 10 minutes
    99  redis.7.bg8c07zzg87di2mufeq51a2qp  redis:3.0.6  swarm-manager1  Running        Running 9 minutes
   100  ```
   101  
   102  
   103  #### desired-state
   104  
   105  The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
   106  
   107  
   108  ## Related commands
   109  
   110  * [node demote](node_demote.md)
   111  * [node inspect](node_inspect.md)
   112  * [node ls](node_ls.md)
   113  * [node promote](node_promote.md)
   114  * [node rm](node_rm.md)
   115  * [node update](node_update.md)