Home > Software design >  Is there a way to turn off the output docker provides after "docker stop [container]" and
Is there a way to turn off the output docker provides after "docker stop [container]" and

Time:11-01

I'm building my own backup script at the moment and therefore want to turn my docker instances on and off in a shell script.

So far this has been working perfectly, the only gripe I have with it is, that after it shuts down or starts a docker instance it throws the ID in the shell and I would love to get rid of that

docker start [containers]
4977db52f155
8063645c1a41
5b56a8ad3c72
65a0df7e8896

CodePudding user response:

You can redirect the output to null.

docker stop [containers] > /dev/null 2>&1

or 

docker stop [containers] &>/dev/null

https://www.cyberciti.biz/faq/how-to-redirect-output-and-errors-to-devnull/

  • Related