tee命令

Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。

tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。

➜  ~ tee file    
1
1
exit
exit
q
q
^C
➜  ~ cat file 
1
exit
q

tee也可以和其他命令配合使用,以到达重定向的目的。相比重定向,tee具有输出反馈,这个功能在某些时候是很有用的,比如系统初始化信息保存到文件并打印。

➜  ~ ls|tee file2
Applications
Desktop
Documents
Downloads
GoProjects
IdeaProjects
Library
Movies
Music
Pictures
Postman
Public
TeamFile
conf
ddsconsole
file
go
logs
vipsrv-logs
➜  ~ cat file2 
Applications
Desktop
Documents
Downloads
GoProjects
IdeaProjects
Library
Movies
Music
Pictures
Postman
Public
TeamFile
conf
ddsconsole
file
go
logs
vipsrv-logs
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值