tee命令详解
Posted machangwei-8
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tee命令详解相关的知识,希望对你有一定的参考价值。
参考:http://man.linuxde.net/tee
tee命令用于将数据重定向到文件,另一方面还可以提供一份重定向数据的副本作为后续命令的stdin。简单的说就是把数据重定向到给定文件和屏幕上。
存在缓存机制,每1024个字节将输出一次。若从管道接收输入数据,应该是缓冲区满,才将数据转存到指定的文件中。若文件内容不到1024个字节,则接收完从标准输入设备读入的数据后,将刷新一次缓冲区,并转存数据到指定文件。
[[email protected] /root/mcw] test!
#ls
a.txt diff.txt hostbuji.sh mcwpaixu.txt quanji.txt te.txt ziji.txt
#ls
a.txt diff.txt hostbuji.sh mcwpaixu.txt quanji.txt te.txt ziji.txt
[[email protected] /root/mcw] test!
#cat te.txt
a.txt
diff.txt
hostbuji.sh
mcwpaixu.txt
quanji.txt
ziji.txt
#cat te.txt
a.txt
diff.txt
hostbuji.sh
mcwpaixu.txt
quanji.txt
ziji.txt
[[email protected] /root/mcw] test!
#cat a.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
#cat a.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
[[email protected] /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.
#cat a.txt |tee te.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
[[email protected] /root/mcw] test!
#cat te.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
#cat te.txt
wo shi mcw, nihao
how do you do
魔降风云变
i want to go to school by bus.
以上是关于tee命令详解的主要内容,如果未能解决你的问题,请参考以下文章