Skip to content

Instantly share code, notes, and snippets.

@pablo384
Created February 18, 2020 15:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablo384/a5bfcc61a562f0f9e35b24b193e5043b to your computer and use it in GitHub Desktop.
Save pablo384/a5bfcc61a562f0f9e35b24b193e5043b to your computer and use it in GitHub Desktop.
Delete all docker images ans Containers except one
#/bin/sh
#images
docker image rm -f $(docker images -a | grep -v "qtcustom" | awk 'NR>1 {print $3}')
#container
docker rm $(docker ps -a | grep -v "my_docker" | awk 'NR>1 {print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment