nohup 使用

让程序在后台运行

$ nohup ./program &

注:由于使用nohup时,会自动将输出写入nohup.out文件中,如果文件很大的话,nohup.out就会不停的增大,因此,可以利用/dev/null来解决这个问题。

$ nohup ./program >/dev/null 2>log &

如果错误信息也不想要的话:

$ nohup ./program >/dev/null 2>&1 &

猜你喜欢

转载自tzhennan.iteye.com/blog/2414171
今日推荐