run a shell script and immediately background it, however keep the ability to inspect its output

前端 未结 2 1055
我寻月下人不归
我寻月下人不归 2020-12-02 14:35

How can I run a shell script and immediately background it, however keep the ability to inspect its output any time by tailing /tmp/output.txt

It would be nice if I

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 15:03

    Another way is using the nohup command with & at the end of the line.

    Something like this

    nohup whatevercommandyouwant whateverparameters &
    

    This will run it in the background and send its output to a nohup.log file.

提交回复
热议问题