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.
Asked
Active
Viewed 2,683 times
1 Answers
9
Send stderr to /dev/null:
docker container rm container-name 2> /dev/null
Cyrus
- 77,979
- 13
- 71
- 125
-
thanks, that works, but how do I silence both the error and success at the same time? – Dave Apr 28 '19 at 14:14
-
1Rather, replace `2>` with `&>`. – John Kugelman Apr 28 '19 at 15:52