首页 > 其他 > 详细

tee命令详解

时间:2018-09-02 00:27:05      阅读:333      评论:0      收藏:0      [点我收藏+]

 

基础命令学习目录首页

 

参考:http://man.linuxde.net/tee

tee命令用于将数据重定向到文件,另一方面还可以提供一份重定向数据的副本作为后续命令的stdin。简单的说就是把数据重定向到给定文件和屏幕上。

技术分享图片

存在缓存机制,每1024个字节将输出一次。若从管道接收输入数据,应该是缓冲区满,才将数据转存到指定的文件中。若文件内容不到1024个字节,则接收完从标准输入设备读入的数据后,将刷新一次缓冲区,并转存数据到指定文件。

[root@mayun /root/mcw] test!
#ls
a.txt  diff.txt  hostbuji.sh  mcwpaixu.txt  quanji.txt  te.txt  ziji.txt
[root@mayun /root/mcw] test!
#cat te.txt
a.txt
diff.txt
hostbuji.sh
mcwpaixu.txt
quanji.txt
ziji.txt
[root@mayun /root/mcw] test!
#
[root@mayun /root/mcw] test!
#cat a.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
[root@mayun /root/mcw] test!
#cat a.txt |tee te.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
[root@mayun /root/mcw] test!
#cat te.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.

 

tee命令详解

原文:https://www.cnblogs.com/machangwei-8/p/9572146.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!