summaryrefslogtreecommitdiff
path: root/docs/reference/commandline/node_ps.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/reference/commandline/node_ps.md')
-rw-r--r--docs/reference/commandline/node_ps.md52
1 files changed, 30 insertions, 22 deletions
diff --git a/docs/reference/commandline/node_ps.md b/docs/reference/commandline/node_ps.md
index 7f07c5ea64..e2e1418287 100644
--- a/docs/reference/commandline/node_ps.md
+++ b/docs/reference/commandline/node_ps.md
@@ -28,20 +28,23 @@ Options:
--no-trunc Do not truncate output
```
-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.
+## Description
-Example output:
+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.
- $ docker node ps swarm-manager1
- NAME IMAGE NODE DESIRED STATE CURRENT STATE
- redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours
- redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds
- redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
- redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds
- redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
+## Examples
+```bash
+$ docker node ps swarm-manager1
+NAME IMAGE NODE DESIRED STATE CURRENT STATE
+redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours
+redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds
+redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
+redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds
+redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
+```
-## Filtering
+### Filtering
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
@@ -59,23 +62,27 @@ The `name` filter matches on all or part of a task's name.
The following filter matches all tasks with a name containing the `redis` string.
- $ docker node ps -f name=redis swarm-manager1
- NAME IMAGE NODE DESIRED STATE CURRENT STATE
- redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours
- redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds
- redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
- redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds
- redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
-
+```bash
+$ docker node ps -f name=redis swarm-manager1
+
+NAME IMAGE NODE DESIRED STATE CURRENT STATE
+redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours
+redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds
+redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
+redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds
+redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
+```
#### id
The `id` filter matches a task's id.
- $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
- NAME IMAGE NODE DESIRED STATE CURRENT STATE
- redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
+```bash
+$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
+NAME IMAGE NODE DESIRED STATE CURRENT STATE
+redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
+```
#### label
@@ -86,6 +93,7 @@ The following filter matches tasks with the `usage` label regardless of its valu
```bash
$ docker node ps -f "label=usage"
+
NAME IMAGE NODE DESIRED STATE CURRENT STATE
redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes
redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes
@@ -97,7 +105,7 @@ redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running R
The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
-## Related information
+## Related commands
* [node demote](node_demote.md)
* [node inspect](node_inspect.md)