Linux Tee

功能说明: 读取标准输入的数据,并将其内容输出成文件。    语  法:tee [-ai][--help][--version][文件...]  
补充说明:tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。  
参  数:  -a或--append  附加到既有文件的后面,而非覆盖它.   -i-i或--ignore-interrupts  忽略中断信号。   --help  在线帮助。   --version  显示版本信息。  

英文版本,欢迎翻译:

ABOUT TEE

Read from an input and write to a standard output or file.

SYNTAX

telnet [OPTION]... [FILE]...

-a --append Append to the given FILEs, do not overwrite. -i ignore interrupt signals. --help Display the help screen. --version Display the version.


EXAMPLES

ls *.txt | wc -l | tee /dev/tty count.txt

In the above example the ls command would list all .htm files in the current directory, take a word count (wc) by the amount of lines (-l) and the output displayed to the /dev/tty (terminal) will be sent to the count.txt.

Note: Because the above example did not take advantage of the -a or append option if the count.txt file already existed it would have been overwritten.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值