EN
Docker - list only container ids
7
points
In this short article, we would like to show how to list ids of run containers in Docker.
Quick solution (run following command):
docker ps -q
Output:
d76423e8e259
f44b6ffcee6a
25605bf8dc3f
c14692b929b2
8867d0ac1ed1
252ab6485893
Alternative solution
The approach presented in the section cuts first field that is Container ID and removes column heading.
Command example:
docker ps | cut -f 1 -d " " | tail -n +2
Output:
d76423e8e259
f44b6ffcee6a
25605bf8dc3f
c14692b929b2
8867d0ac1ed1
252ab6485893