tee 命令用法
2011-08-03 13:54
218 查看
Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.
-a, --append append to the given FILEs, do not overwrite
tee 是将命令结果同时输出到屏幕和文件,一般和管道结合使用。
如果使用 -a 选项,就是追加数据到文件中。否则,就是覆盖文件。
$ ls | tee output.txt
hello.c
Makefile
$ cat output.txt
hello.c
Makefile
$ cal | tee output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
$ cat output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
$ ls | tee -a output.txt
hello.c
Makefile
output.txt
$ cat output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
hello.c
Makefile
output.txt
Copy standard input to each FILE, and also to standard output.
-a, --append append to the given FILEs, do not overwrite
tee 是将命令结果同时输出到屏幕和文件,一般和管道结合使用。
如果使用 -a 选项,就是追加数据到文件中。否则,就是覆盖文件。
$ ls | tee output.txt
hello.c
Makefile
$ cat output.txt
hello.c
Makefile
$ cal | tee output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
$ cat output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
$ ls | tee -a output.txt
hello.c
Makefile
output.txt
$ cat output.txt
August 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
hello.c
Makefile
output.txt
相关文章推荐
- tee命令用法
- tee命令的小用法
- tee命令用法小结
- linux shell用法(1)-- tee命令
- tee命令_Linux tee 命令用法详解:把数据重定向到给定文件和屏幕上
- linux命令tee的用法
- tee命令用法
- tee 命令的用法
- tee命令用法
- mysql中授权(grant)和撤销授权(revoke)等命令的用法详解
- Linux中xdg-open命令的用法
- CRSCTL和SRVCTL的命令用法
- Docker学习笔记:Docker 基础用法和命令帮助
- linux命令篇(1)-parted命令用法
- Linux下Sed命令的用法(之替换)
- vi 命令 用法
- linux tee 命令详解
- redisCommand接口的用法--利用hiredis库获取MGET命令的结果的坑!
- Linux中rz和sz命令用法详解
- linux认证:玩转Linux终端命令用法精选