使用 nohup -> 输出到文件和控制台

using nohup -> output to file and console

我在我的项目中使用 nohup。 是否有可能在使用 nohup 时将程序的输出同时输出到控制台和文件?

"tee"我没有成功:

nohup ./programm 2>&1 | tee Output.txt

感谢帮助

试试这个 运行 并将输出记录到文件中。

nohup ./program  > Output.txt | tail -F Output.txt &

如果你想运行它在后台:

nohup ./program  > Output.txt &