tee命令可以使程序的执行结果同时定向到标准输出和文件中。
它的一般用法为:
tee -a files
-a 表示追加到文件结尾.
如:
[zhanghua@localhost daemon]$ who | tee /tmp/who.out
zhanghua pts/0 Oct 23 10:15 (172.16.102.81)
zhanghua pts/1 Oct 23 10:40 (172.16.102.81)
root pts/2 Oct 23 14:30 (172.16.102.81)
root pts/3 Oct 23 14:42 (172.16.102.81)
[zhanghua@localhost daemon]$ cat /tmp/who.out
zhanghua pts/0 Oct 23 10:15 (172.16.102.81)
zhanghua pts/1 Oct 23 10:40 (172.16.102.81)
root pts/2 Oct 23 14:30 (172.16.102.81)
root pts/3 Oct 23 14:42 (172.16.102.81)
阅读(1199) | 评论(0) | 转发(0) |