gpt4 book ai didi

linux - 如何从 nohup 保留 stderr?

转载 作者:太空宇宙 更新时间:2023-11-04 03:37:15 25 4
gpt4 key购买 nike

如果 stderr 指向终端,则 Nohup 将其重定向到 stdout。但我想保留 stderr 输出到终端

有办法实现吗?有替代方案吗?

最佳答案

不知道我理解对不对。您的意思是您不想在终端中看到错误?如果是:如果你想将错误保存在文件中:

nohup command 2> file.txt 

如果您不需要这些错误:

nohup command 2> /dev/null 

2表示命令的错误输出

<小时/>

2> file.txt 表示将错误输出写入file.txt

关于linux - 如何从 nohup 保留 stderr?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31155022/

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