Asynchronous shell commands

后端 未结 5 1597
一向
一向 2020-12-04 08:48

I\'m trying to use a shell script to start a command. I don\'t care if/when/how/why it finishes. I want the process to start and run, but I want to be able to get back to my

5条回答
  •  暖寄归人
    2020-12-04 09:23

    nohup cmd
    

    doesn't hangup when you close the terminal. output by default goes to nohup.out

    You can combine this with backgrounding,

    nohup cmd &
    

    and get rid of the output,

    nohup cmd > /dev/null 2>&1 &
    

    you can also disown a command. type cmd, Ctrl-Z, bg, disown

提交回复
热议问题