linux数据重定向&管道

 1、linux数据重定向。

#将错误输出信息关闭掉
[chengmo@centos5 shell]$ ls test.sh test1.sh 2>&-
test.sh
[chengmo@centos5 shell]$ ls test.sh test1.sh 2>/dev/null
test.sh
#&[n] 代表是已经存在的文件描述符,&1 代表输出 &2代表错误输出 &-代表关闭与它绑定的描述符
#/dev/null 这个设备,是linux 中黑洞设备,什么信息只要输出给这个设备,都会给吃掉 

  参考:http://www.cnblogs.com/chengmo/archive/2010/10/20/1855805.html

 2、linux管道。

  参考:http://www.cnblogs.com/chengmo/archive/2010/10/21/1856577.html

相关文章:

  • 2021-11-08
  • 2021-05-25
  • 2021-08-06
  • 2021-12-14
  • 2022-01-07
  • 2021-07-30
  • 2022-12-23
猜你喜欢
  • 2021-06-28
  • 2021-10-27
  • 2021-09-10
  • 2022-01-03
  • 2022-01-24
  • 2022-01-14
  • 2022-12-23
相关资源
相似解决方案