bashには、次の3つのストリームタイプがあります。
- 0(STDIN)
- 1(STDOUT)
- 2(STDERR)
したがって、いくつかのプログラムを実行している間、私はこれらのストリームを使用できます(たとえば、コンソールから/ dev / nullなどのファイルまたはsmthにリダイレクトできます):
# only errors from STDERR will be shown, STDOUT will be moved to /dev/null
command > /dev/null
# only STDOUT will be shown, STDERR will be moved to /dev/null
command 2> /dev/null
何人かの人が書くのを見ました
command &> /dev/null
>
と&>
bashの違いは何ですか?