Languages
[Edit]
EN

Docker - list only container ids

7 points
Created by:
Violet-Hoffman
652

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
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Docker - useful wiki posts

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join