Linux中使用nohup挂载Python程序

#加-u 关闭python输出的缓冲
nohup python -u hello.py &

tail nohup.out
#-f tail不停的实时输出
tail -f nohup.out
```

```

nohup python myfile.py > myout.out 2>&1 &

 

#nohup的重定向输出到 myout.out

$ nohup python -u myfile.py > myout.out  &

 

#tail -f 不停的实时输出
$ tail -f myout.out

 

#停止运行程序

kill -9  PID

 

posted @ 2019-04-27 13:27  王学长  阅读(567)  评论(0编辑  收藏  举报