输出重定向

将错误信息与正确信息合并为一个文件   

[root@localhost sh]# mkdir /root/test >  /dev/null  2>&1

错误信息输出到/dev/null中:

[root@localhost sh]# mkdir /root/test 2> /dev/null

正确信息输出到/dev/null中

[root@localhost sh]# mkdir /root/test 1> /dev/null

mkdir: cannot create directory ‘/root/test’: File exists

原文地址:https://www.cnblogs.com/byfboke/p/9272520.html