什么>&在指挥?

时间:2014-06-09 16:18:04

标签: linux

module load PrgEnv/intel/default >& /dev/null

此命令中>&的含义是什么?

1 个答案:

答案 0 :(得分:1)

让我们在man bash中查找:

   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会抑制命令中的输出和错误/信息性消息。