Linux tee命令
Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。
tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。
语法
tee [-ai][--help][--version][文件...]
参数:
- -a或--append 附加到既有文件的后面,而非覆盖它.
- -i或--ignore-interrupts 忽略中断信号。
- --help 在线帮助。
- --version 显示版本信息。
[root@centos7 test]# ls
[root@centos7 test]# seq 3 #形成序列3
1
2
3
[root@centos7 test]# ls
[root@centos7 test]# seq 3 | tee a.txt #保存至文件a.txt
1
2
3
[root@centos7 test]# ls
a.txt
[root@centos7 test]# cat a.txt
1
2
3