使./a.out后臺運行
nohup ./a.out &
exit // 如果你使用的bash客戶端或者是screen窗口,直接關閉窗口那么該進程也會終止,所以要用exit
關于nohup重定向
在使用nohup命令的時候,經常由于輸出nohup.out的路徑沒有寫入權限,而無法使用nohup。
這是可以使用Linux重定向的方法,將nohup.out重定向至一個有寫入權限的路徑,或者直接扔到/dev/null中。
nohup ./program >/dev/null 2>/dev/null &
或者
nohup ./program >/dev/null 2>&1 &
參考文章
https://blog.csdn.net/blueheart20/article/details/78226066
https://www.cnblogs.com/quchunhui/p/5582371.html
http://aniyo.iteye.com/blog/1496442
https://blog.csdn.net/jiangyu1013/article/details/81476184