Skip to content

Instantly share code, notes, and snippets.

@sepastian
Created October 7, 2020 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sepastian/e36ddbb6c1fb2534f9a8b3972dd2d0cd to your computer and use it in GitHub Desktop.
Save sepastian/e36ddbb6c1fb2534f9a8b3972dd2d0cd to your computer and use it in GitHub Desktop.
Remove exited docker containers.
#!/bin/bash
set -euo pipefail
IFS=$'\t\n'
docker rm \
$(docker ps -a | grep Exited | awk -F ' ' '{print $NF}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment