gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:34:24 27 4
gpt4 key购买 nike

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

使用“tee”我没有成功:

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

感谢帮助

最佳答案

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

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

如果你想在后台运行它:

nohup ./program  > Output.txt &

关于linux - 使用 nohup -> 输出到文件和控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40421112/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com