tee
功能说明:读取标准输入的数据,并将其内容输出成文件。
语 法:tee [-ai][--help][--version][文件…]
补充说明:tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。我们可利用tee把管道导入的数据存成文件,甚至一次保存数份文件。
参 数:-a 附加到既有文件的后面,而非覆盖它。如果给予tee指令的文件名称已经存在,预设会覆盖该文件的内容。加上此参数后,数据会新增在该文件内容的最后面,而不会删除原先之内容。
-i 忽略中断信号
--help 在线帮助
--version 显示版本信息
范 例:
列出文本文件slayers.story的内容,同时复制3份副本,文件名称分别为ss-copy1、ss-copy2、ss-copy3:
$ cat slayers.story |tee ss-copy1 ss-copy2 ss-copy3
tee [-ai][--help][--version][文件...]
【功能】
tee以标准输入作为输入,标准输出和文件作为输出。
【举例】
tee file //覆盖
tee -a file //追加
tee - //输出到标准输出两次
tee - - //输出到标准输出三次
tee file1 file2 - //输出到标准输出两次,并写到那两个文件中
ls | tee file
另:把标准错误也被tee读取
ls "*" 2>&1 | tee ls.txt
*用tee生成一个文件,包含你敲入的内容:
复制代码代码如下:
$tee testfile
这样,会提示要你用标准输入输入内容,然后敲回车会将你输入的内容写入testfile和输出到标准输出,如果用[Ctrl]d结束输入([Ctrl]c也行)。如果原来testfile有内容,将会覆盖。
*把内容追加到文件的末尾行:
复制代码代码如下:
$tee -a testfile
结果类似上,不过如果原来testfile有内容则不会覆盖而是追加。
*生成一个文件,敲入的时候,不接受中断信号:
复制代码代码如下:
$tee -i testfile
结果同testfile,不过不会接收中断信号,只能用[Ctrl]d结束,而不能用[Ctrl]c了。
*执行ls列出目录文件同时将输出保存到文件test中:
复制代码代码如下:
$ls | tee test
这样,会像平时一样执行ls命令并将当前目录的文件名输出到标准输出。另外由于进行了tee命令,所以会生成一个test文件,这个test文件的内容和标准输出的内容一样。
【描述】
tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。可以用于既想看到标准输出,又想将标准输出保存到文件中的情况。
参数:
-a或--append 附加到既有文件的后面,而非覆盖它.
-i-i或--ignore-interrupts 忽略中断信号。
--help 在线帮助。
--version 显示版本信息。
常用参数
格式:tee
只输出到标准输出,因为没有指定文件嘛。
格式:tee file
输出到标准输出的同时,保存到文件file中。如果文件不存在,则创建;如果已经存在,则覆盖之。(If a file being written to does not already exist, it is created. If a file being written to already exists, the data it previously
contained is overwritten unless the `-a' option is used.)
格式:tee -a file
输出到标准输出的同时,追加到文件file中。如果文件不存在,则创建;如果已经存在,就在末尾追加内容,而不是覆盖。
格式:tee -
输出到标准输出两次。(A FILE of `-' causes `tee' to send another copy of input to standard output, but this is typically not that useful as the copies are interleaved.)
格式:tee file1 file2 -
输出到标准输出两次,同时保存到file1和file2中。
使用示例补充:
示例一 tee命令与重定向的对比
[root@web ~]# seq 5 >1.txt
[root@web ~]# cat 1.txt
1
2
3
4
5
[root@web ~]# cat 1.txt >2.txt
[root@web ~]# cat 1.txt | tee 3.txt
1
2
3
4
5
[root@web ~]# cat 2.txt
1
2
3
4
5
[root@web ~]# cat 3.txt
1
2
3
4
5
[root@web ~]# cat 1.txt 2.txt
[root@web ~]# cat 1.txt | tee -a 3.txt
1
2
3
4
5
[root@web ~]# cat 2.txt
1
2
3
4
5
1
2
3
4
5
[root@web ~]# cat 3.txt
1
2
3
4
5
1
2
3
4
5
[root@web ~]#
示例二 使用tee命令重复输出字符串
[root@web ~]# echo 12345 | tee
12345
[root@web ~]# echo 12345 | tee -
12345
12345
[root@web ~]# echo 12345 | tee - -
12345
12345
12345
[root@web ~]# echo 12345 | tee - - -
12345
12345
12345
12345
[root@web ~]# echo 12345 | tee - - - -
12345
12345
12345
12345
12345
[root@web ~]#
[root@web ~]# echo -n 12345 | tee
12345[root@web ~]# echo -n 12345 | tee -
1234512345[root@web ~]# echo -n 12345 | tee - -
123451234512345[root@web ~]# echo -n 12345 | tee - - -
12345123451234512345[root@web ~]# echo -n 12345 | tee - - - -
1234512345123451234512345[root@web ~]#
示例三 使用tee命令把标准错误输出也保存到文件
[root@web ~]# ls "*"
ls: *: 没有那个文件或目录
[root@web ~]# ls "*" | tee -
ls: *: 没有那个文件或目录
[root@web ~]# ls "*" | tee ls.txt
ls: *: 没有那个文件或目录
[root@web ~]# cat ls.txt
[root@web ~]# ls "*" 2>&1 | tee ls.txt
ls: *: 没有那个文件或目录
[root@web ~]# cat ls.txt
ls: *: 没有那个文件或目录
[root@web ~]#
linux,tee
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]