linux后台执行程序

参考:

https://www.cnblogs.com/sidianok/p/13176754.html

关键指令:nohup

nohup command > myout.file 2>&1 &

例子:

推荐:

nohup python -u abc.py > nohup.log 2>&1 &  (加上-u,随时写入,参考:https://www.cnblogs.com/lanlingshao/p/10260600.html)

nohup bash test.sh > out.file 2>&1 &

查看日志:

tail -f 文件名

原文地址:https://www.cnblogs.com/qiezi-online/p/14046797.html