How to list all docker container IDs

How to list all docker container IDs

 

1. Log into your linux server via SSH as root user or sudo user

2. Use -q option with docker ps command to print only the container IDs

3. Run docker ps command with –no-trunc option to print the full container ID

-q, –quiet = Only display numeric IDs
–no-trunc = Don’t truncate output

 

 

# docker ps -aq
OR
# docker ps –all –quiet

b3d14ecb4784
5cada4930d60
d2031adbf4d5
0f2536c1bf97

# docker ps -aq –no-trunc
OR
# docker ps –all –quiet –no-trunc

b3d14ecb4784a0cdeeae6fa1b79bf245422863c3b2fd48e704a6431f74ff9959
5cada4930d6046a5b23a60eba4d57f20417378619d6ca7959c55f4e5501166e6
d2031adbf4d5a37ed656228d527f5c8b948c336b631e7b56dc656026d22c885d
0f2536c1bf972fe599842fa56138a4ec396a58fd30d1a7cc3909407367dcf6d8
06be05d000b40118010e9b7e190d5bcddb5aaddade3e1ed0dc6b7b5d12b062e1