• Contact Us
  • copyright
  • About Us
  • Privacy Policy
  • Devops
  • Linux
Globedrill

How to List Docker containers

Linux/06 Jun, 20/281/0
Linux

How to List Docker containers

 

1. Log into your host machine as ‘root’ or as sudo user

2. Run the command ‘docker ps’ to list all running containers

3. Run the command ‘docker ps -a’ to list all running and exited containers
 
 

Steps explained:

 
Open a new terminal and log into your server as root user or as ‘sudo’ user

1. How to list all running and stopped docker containers

Run the below command to see all containers (output include both running and exited containers)

Command :

 

# docker ps -a

OR

# docker ps --all

 

How to list all running and stopped docker containers

How to list all running and stopped docker containers


 
2. How to list all running docker containers

docker ps command without any options will show all the containers

Command :
 

# docker ps

 

How to list all running docker containers

How to list all running docker containers


 
3. How to list all docker containers and their size

Command to see size of all running containers :
 

docker ps -s

 
Command to see size of all running and exited containers :
 

docker ps -as

 
4. How to print only the docker container IDs

Command to print container ID of running containers :
 

# docker ps -q

 
Command to print container ID of running and exited containers :
 

# docker ps -aq

 

How to print only the docker container ID

How to print only the docker container ID


 
5. How to use filter in docker container list

command to filter only the running instances
 

# docker ps –filter status=running

 

 
6. How to show the latest created container

command to show the latest created container
 

# docker ps -l

 

.

About Us

Globedrill.com is a website that publishes articles related to Linux and Devops. Globedrill was started on April 2016.

Contact Us

Email : globedrill.c@gmail.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • About Us
  • Privacy Policy
  • Contact Us
  • copyright