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:
Share on LinkedIn
Quick Share: Your custom post text has been copied to your clipboard! Click the button below to open LinkedIn's share dialog, then paste it.
💡 Tip: LinkedIn will open in a new tab. Use Ctrl+V (or Cmd+V on Mac) to paste your text.
Note: LinkedIn will show the article preview. You can add your custom text above it.