2

I tried docker container rm container-name > /dev/null but this still prints Error: No such container: container-name. I'm trying to silence this error in my bash script.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Dave
  • 457
  • 1
  • 7
  • 16

1 Answers1

11

Send stderr to /dev/null:

docker container rm container-name 2> /dev/null
Cyrus
  • 84,225
  • 14
  • 89
  • 153