关于Linux:命令中的>&意味着什么?

What does >& mean in command?

本问题已经有最佳答案,请猛点这里访问。
1
module load PrgEnv/intel/default >& /dev/null

在这个命令中,>&的含义是什么?


让我们在man bash中查找:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
   Redirecting Standard Output and Standard Error
   This construct allows both the standard output (file descriptor 1) and the  stan‐
   dard  error output (file descriptor 2) to be redirected to the file whose name is
   the expansion of word.

   There are two formats for redirecting standard output and standard error:

          &>word
   and
          >&word

   Of the two forms, the first is preferred.  This is semantically equivalent to

          >word 2>&1

换句话说,>& /dev/null抑制来自命令的输出和错误/信息消息。