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
  • 77,979
  • 13
  • 71
  • 125
Dave
  • 407
  • 6
  • 15

1 Answers1

9

Send stderr to /dev/null:

docker container rm container-name 2> /dev/null
Cyrus
  • 77,979
  • 13
  • 71
  • 125