sh 将stderr重定向到stdout

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将stderr重定向到stdout相关的知识,希望对你有一定的参考价值。

# Redirect stdout to /dev/null, and then redirect stderr to stdout
command >/dev/null 2>&1

# You can pipe it to another command
command >/dev/null 2>&1 | grep 'your word'

以上是关于sh 将stderr重定向到stdout的主要内容,如果未能解决你的问题,请参考以下文章