Linux tee命令
Linux 教程
· 2019-02-14 07:42:14
Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。
tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。
语法
tee [-ai][--help][--version][文件...]
参数:
- -a或--append 附加到既有文件的后面,而非覆盖它.
- -i或--ignore-interrupts 忽略中断信号。
- --help 在线帮助。
- --version 显示版本信息。
实例
使用指令"tee"将用户输入的数据同时保存到文件"file1"和"file2"中,输入如下命令:
$ tee file1 file2 #在两个文件中复制内容
以上命令执行后,将提示用户输入需要保存到文件的数据,如下所示:
My Linux #提示用户输入数据 My Linux #输出数据,进行输出反馈
此时,可以分别打开文件"file1"和"file2",查看其内容是否均是"My Linux"即可判断指令"tee"是否执行成功。
点击查看所有 Linux 教程 文章: https://codercto.com/courses/l/14.html
The Creative Curve
Allen Gannett / Knopf Doubleday Publishing Group / 2018-6-12
Big data entrepreneur Allen Gannett overturns the mythology around creative genius, and reveals the science and secrets behind achieving breakout commercial success in any field. We have been s......一起来看看 《The Creative Curve》 这本书的介绍吧!
HTML 压缩/解压工具
在线压缩/解压 HTML 代码
Markdown 在线编辑器
Markdown 在线编辑器