I have windows docker installed and when I run this on command line:
docker stop $(docker ps -q)
I get:
unknown shorthand flag: 'q' in -q)
But when running:
docker ps -q
Everything is alright. Any clues?
The $(sub command) is a syntax of the bash shell (along with many other command shells on Linux). If you try to run this from a Windows command prompt, it will not be correctly expanded before running the rest of the command and you'll see the errors you're encountering. Try installing and running the commands on bash for Windows.
I used this in Windows:
powershell docker stop $(docker ps -aq)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With