ubuntu nohup进程日志追加而不是替换文件

时间:2017-05-23 15:50:39

标签: logging append ubuntu-16.04 nohup

我读了这个问题 How to get the process ID to kill a nohup process?答案很棒。但是我需要问一下我是否写了#34;大于"在这两种情况下,char都是两次

  

nohup my_command>> my.log 2>>& 1&

而不是

  

nohup my_command> my.log 2>& 1&

它会附加到同一个文件而不是替换它吗?

提前致谢

1 个答案:

答案 0 :(得分:2)

  

使用nohup my_command >> my.log 2>&1 &附加日志文件。

无需更改2>&1 &
2>&1忽略标准输入。
最后&是让您的流程背景。