原文: http://man.linuxde.net/tee

------------------------------------------------------------------------------------------------------------

tee命令用于将数据重定向到文件,另一方面还可以提供一份重定向数据的副本作为后续命令的stdin。简单的说就是把数据重定向到给定文件和屏幕上。

存在缓存机制,每1024个字节将输出一次。若从管道接收输入数据,应该是缓冲区满,才将数据转存到指定的文件中。若文件内容不到1024个字节,则接收完从标准输入设备读入的数据后,将刷新一次缓冲区,并转存数据到指定文件。

语法

tee(选项)(参数)

选项

-a:向文件中重定向时使用追加模式;
-i:忽略中断(interrupt)信号。

参数

文件:指定输出重定向的文件。

在终端打印stdout同时重定向到文件中:

ls | tee out.txt
1.sh
1.txt
2.txt
eee.tst
EEE.tst
one
out.txt
string2
www.pdf
WWW.pdf
WWW.pef
[root@localhost text]# ls | tee out.txt | cat -n
1 1.sh
2 1.txt
3 2.txt
4 eee.tst
5 EEE.tst
6 one
7 out.txt
8 string2
9 www.pdf
10 WWW.pdf
11 WWW.pef

tee -a /var/log/jd.log的更多相关文章

  1. MySql开启慢查询报错:Could not open /var/log/slow_query.log for logging (error 13).

    Turning logging off for the whole duration of the MySQL server process. File '/var/log/slow_query.lo ...

  2. 关于Mysql错误:./bin/mysqld_safe --user=mysql& [1] 32710 121003 16:40:22 mysqld_safe Logging to '/var/log/mysqld.log'. 121003 16:40:22 mysqld_s

    [root@www]# ./bin/mysqld_safe --user=mysql&[1] 32710[root@www]# 121003 16:40:22 mysqld_safe Logg ...

  3. 安装mysql后在/var/log/mysqld.log 中找不到临时密码

    centos7通过yum装完mysql,使用grep 'temporary password' /var/log/mysqld.log找不到root密码打开mysqld.log中根本没有tempora ...

  4. FTP:500 OOPS: failed to open vsftpd log file:/var/log/vsftpd.log

    如下:从10.12.8.165 FTP 到 10.1.3.34,报failed to open vsftpd log[a4_csbdc@localhost ~]$ ftp  10.1.3.34Conn ...

  5. 系统启动日志:/var/log/boot.log

    /var/log/boot.log — 记录系统启动时的日志信息,如果系统启动之后有什么异常可以查看该文件信息 [root@localhost ~]# cat /var/log/boot.log # ...

  6. touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?

    问题:在从 https://c.163.com/hub#/m/repository/?repoId=3093 下载镜像 docker pull hub.c.163.com/library/jenkin ...

  7. touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied

    docker 运行后, 执行docker logs -f myjenkins时报错: touch: cannot touch ‘/var/jenkins_home/copy_reference_fil ...

  8. docker挂载目录问题:touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied

    docker 运行后, 执行docker logs -f myjenkins时报错:touch: cannot touch '/var/jenkins_home/copy_reference_file ...

  9. log4j:ERROR Failed to rename [/log/xxx.log] to [/log/xxx.log.2016-11-23.log]

    Log4j报错: log4j:ERROR Failed to rename [/log/xxx.log] to [/log/xxx.log.2016-11-23.log] google了一下发现是个b ...

随机推荐

  1. Docker for Windows 里的Shared Drives 设置不生效

    原文地址:传送门 问题描述:Docker中的settings里的Shared Drives 选择对应盘符后,点击Apply后无法生效,没办法选择对应盘符进行分享. 解决办法:win+R ,键入gped ...

  2. JS中的对象和方法简单剖析

    众所周知,在js中对象就是精髓,不理解对象就是不理解js. 那么什么事js中的对象呢? 在js中,几乎一切皆对象: Boolean ,String,Number可以是对象(或者说原生数据被认作对象): ...

  3. jquery.bootpag分页控件

    <script src="//code.jquery.com/jquery-2.1.3.min.js"></script> <script src=& ...

  4. Appscan的第一个测试请求就是提交MAC地址

    GET /AppScan_fingerprint/MAC_ADDRESS_真实的MAC地址.html HTTP/1.0 还好都是合法测试,否则情何以堪...

  5. Codeforces 补题记录

    首先总结一下前段时间遇到过的一些有意思的题. Round #474 (Div. 1 + Div. 2, combined)   Problem G 其实关键就是n这个数在排列中的位置. 这样对于一个排 ...

  6. 求高精度幂(poj1001)

    Description Problems involving the computation of exact values of very large magnitude and precision ...

  7. React 中组件的生命周期

    先上代码, react 用的是 15.0.1 <!DOCTYPE html> <html> <head> <script src="./build/ ...

  8. Codeforces 555 B. Case of Fugitive

    \(>Codeforces \space 555 B. Case of Fugitive<\) 题目大意 : 有 \(n\) 个岛屿有序排列在一条线上,第 \(i\) 个岛屿的左端点为 \ ...

  9. [Nescafé41]异化多肽(多项式求逆元)

    2015年的题,应该是将形式幂级数引入国内的元老级题目. 大意:给定一个大小为m的正整数序列和n,问有多少种选法可以凑成n,每个数可以选多次,种类不同算不同方案.$n,m,C \leqslant 10 ...

  10. 关于lower_bound的优先级重载

    今天才知道$lower\_bound$最后有一个优先级参数…… 首先$lower\_bound$中的优先级和序列优先级必须相同才有效 $lower\_bound$中优先级默认的是小于号,也就是说仅当序 ...