Home > Software design >  Docker delete all images script not working on Ubuntu
Docker delete all images script not working on Ubuntu

Time:07-12

I need your help with a command I was using on Windows but on Ubuntu it won't work for me.

docker images | grep none | awk ' { print $3; } ' | xargs docker rmi -f & cls & docker images

With this command I get: -bash: syntax error near unexpected token `}' as error. cls is an alias I'm using and it's working

CodePudding user response:

If I understand correctly what you want to achieve is to delete all dangling images (images not currently used with as both REPOSITORY and TAG). Then you want to clear the terminal and to get a new list of docker images.

If gets you right the following may be found useful by you:

sudo docker image prune -a -f && clear && sudo docker images

CodePudding user response:

Okay so I got it working with:

docker images | grep none | awk " { print $3; } " | xargs docker rmi -f ; clear ; docker images

Thanks for your efforts tho, it helped me with other problems :)

  • Related