Solution to "unknown shorthand flag a in -a" When Trying to Remove Docker Containers
1 min read
This docker command will remove all stopped containers.
docker rm $(docker ps -a -q)
```text
This docker command will remove all containers, even if they are running.
```bash
docker rm $(docker ps -a -q) -f
```text
If you run this command in a regular Windows Command prompt you will get the following output:
```bash
C:\>docker rm $(docker ps -a -q)unknown shorthand flag: 'a' in -aSee 'docker rm --help'.
The solution is to run this command in a PowerShell terminal or the Docker QuickStart Terminal.
Jon
Share: