Chinaunix首页 | 论坛 | 博客
  • 博客访问: 277974
  • 博文数量: 46
  • 博客积分: 2021
  • 博客等级: 大尉
  • 技术积分: 406
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-03 13:00
文章分类

全部博文(46)

文章存档

2011年(1)

2010年(9)

2009年(2)

2007年(13)

2006年(21)

我的朋友

分类: LINUX

2006-09-25 11:08:50

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)
阅读(1174) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~