tee        可以将数据即输出在屏幕上又可以保存在文件中,例:date  |  tee  filename

    -a    追加数据,默认会替换文本中现有的数据,此选项可以将数据追加到文本中

例1:date  |  tee  -a  demo.txt

例2:

echo  "This is a message" |  tee demo.txt

echo  "This  is a infomation" |  tee  -a  demo.txt