Linux:数据流重定向

1)垃圾桶黑洞

  

 /dev/null

     command 2> /dev/null

  

  

2)stdout与stderr写入同一个文件

    

  

command > filename 2>&1

     command &> filename

3)stdin   <,<<

'<'   将原本要有键盘输入的数据改为由文件内容代替   

 

command > now_file < old_file

'<<' 结束输入

command > file << "eof"

  

原文地址:https://www.cnblogs.com/Spiro-K/p/6361458.html