tee 命令
tee命令用于一方面将数据重定向到文件,另一方面提供一份重定向数据的副本作为后续命令的stdin。tee只能从stdin中进行读取
[root@redhatclient ~]# tee --help
Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.
-a, --append append to the given FILEs, do not overwrite
-i, --ignore-interrupts ignore interrupt signals
--help display this help and exit
--version output version information and exit
-a参数指append在文件末尾
[root@redhatclient ~]# ls |grep a*
anaconda-ks.cfg
[root@redhatclient ~]# ls >log |grep a*
#这个时候没有任何显示,因为stdout的输出到log中去了,没有输出流给grep命令
[root@redhatclient ~]# ls |tee -a log |grep a*
anaconda-ks.cfg
[root@redhatclient ~]#
#可以看到tee的功能