Stop / remove all Docker containers

$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
  1. List containers with docker ps. -a/--all include also the stopped ones and -q/--quiet display only the numeric IDs.
  2. Use docker stop and docker rm with the output of the first command (got from bash command substitution).

References:

results matching ""

    No results matching ""