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

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

```

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

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄