What command is used to remove all unused images, containers, and networks?

Prepare for the Docker Foundations Test. Review essential Docker concepts with multiple choice questions, each with hints and explanations. Ace your exam!

The command that is used to remove all unused images, containers, and networks is "docker system prune." This command is part of Docker's suite of system management commands and is specifically designed to help users reclaim space by removing resources that are no longer in use.

When you use this command, Docker identifies all the resources that are not currently being utilized— such as stopped containers, dangling images, and unused networks— and removes them in one go, making it a powerful tool for maintaining a clean environment. By aggregating these cleanup operations, "docker system prune" simplifies the process, allowing users to easily manage their Docker ecosystem without having to individually remove each type of resource.

The other options, while related to Docker functionality, do not serve the same purpose. For instance, "docker rmi" specifically targets and removes images, but does not address containers or networks. "docker cmd" is not a valid Docker command, and "docker cleanup" is not an established command within Docker's command line interface.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy