输出重定向

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

[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

posted @ 2018-07-06 11:07  天宇星空  阅读(115)  评论(0编辑  收藏  举报