没有带尾的日志内容,但在终止进程时,我看到的内容较少

9uz*_*an7 4 linux io-redirection tail nohup

基本上,我正在运行:

nohup ./executable &> /tmp/out.log &
Run Code Online (Sandbox Code Playgroud)

为了确保进程正在运行,我运行了以下命令:

tail -f /tmp/out.log
Run Code Online (Sandbox Code Playgroud)

但是我唯一能得到的tail是“nohup:忽略输入”,一旦杀死了之前启动的进程,我就可以看到内容out.log

Ipo*_*cer 6

运行你的程序:

nohup stdbuf -oL ./executable &> /tmp/out.log &
Run Code Online (Sandbox Code Playgroud)

stdbuf 可以更改默认缓冲。