首页 > 其他 > 详细

tee命令

时间:2018-04-24 17:16:20      阅读:185      评论:0      收藏:0      [点我收藏+]
tee命令

tee命令可以把数据流同时重定向到文件和屏幕。


语法:

数据流  |  tee [选项]  [文件]


选项:

不加选项:覆盖重定向

-a:追加到文件


实例:

覆盖重定向。

[root@localhost ~]# head -n 2 /etc/passwd | cut -d ":" -f 1-3 | tee 1.txt

root:x:0

bin:x:1

[root@localhost ~]# cat 1.txt

root:x:0

bin:x:1

追加重定向。


[root@localhost ~]# head -n 2 /etc/passwd | cut -d ":" -f 1-3 | tee -a 1.txt

root:x:0

bin:x:1

[root@localhost ~]# cat 1.txt

root:x:0

bin:x:1

root:x:0

bin:x:1


tee命令

原文:http://blog.51cto.com/11060853/2107284

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