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 文件名

posted @ 2020-11-27 10:55  qiezi_online  阅读(105)  评论(0编辑  收藏  举报