# Docker commands to survive

### docker ps –size

An important command which I discovered and use is docker ps --size.
Its show what is the size of the container.

On this case, you can see the column size which show 10.2MB (virtual 110MB). Compare with the output of docker images:

We discover the virtual size is the sum of image size + 10.2MB (this space was used creating a file with dd command).

The slice (or slices) that compose the base image is not used for each instance that you run with docker, only the the difference will be stored on the hard disk.
In this case represented by 10.2MB.

### Inspect a container and discover its pid

If you have any PID that you saw using a lot of resource (like CPU or memory), use this command to inspect all
running dockers and its respective PID - ID - NAME.