How to run a command in the background and get no output?

前端 未结 8 1125
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 05:28

I wrote two shell scripts a.sh and b.sh. In a.sh and b.sh I have a infinite for loop and they print some output to the te

8条回答
  •  眼角桃花
    2020-12-04 05:44

    Sorry this is a bit late but found the ideal solution for somple commands where you don't want any standard or error output (credit where it's due: http://felixmilea.com/2014/12/running-bash-commands-background-properly/)

    This redirects output to null and keeps screen clear:

    command &>/dev/null &
    

提交回复
热议问题