[Shell]给linux命令tee输出文件加个时间
来源:互联网 发布:java implements 用法 编辑:程序博客网 时间:2024/06/06 01:53
android 编译 code 的时候习惯加 tee 命令将屏幕上的输出保存到文件,方便编译出错的时候 debug。多次编译会将之前的同一个文件覆盖掉,可以加 -a 进行追加。这里给出一个解决方法:加个时间尾巴。命令如下:
//ls_20150715_194458.log
ls | tee ls_`date +%Y%m%d_%H%M%S`.log
// 2>&1 把标准错误也被 tee 读取
//build_20150715_195555.log
$ man tee
NAME
tee - read from standard input and write to standard output and files
SYNOPSIS
tee [OPTION]... [FILE]...
DESCRIPTION
Copy standard input to each FILE, and also to standard output.
-a, --append
append to the given FILEs, do not overwrite
-i, --ignore-interrupts
ignore interrupt signals
--help display this help and exit
--version
output version information and exit
If a FILE is -, copy again to standard output.
0 0
- [Shell]给linux命令tee输出文件加个时间
- Linux shell tee 命令
- Linux命令之tee - 重定向输出到多个文件
- Linux命令之tee—重定向输出到多个文件
- tee 命令重定向输出到多个文件
- linux shell用法(1)-- tee命令
- Linux中Tee命令实现日志输出
- Linux Tee (命令行输出并存入文件)
- Linux tee --重定向输出到多个文件
- 我使用过的Linux命令之tee - 重定向输出到多个文件
- linux tee输出终端同时输出到文件
- Shell之tee命令(man tee)
- linux shell--tee
- Linux Shell脚本编程--tee命令
- Linux Shell脚本入门--tee命令
- linux shell 脚本【3】 ---- 重定向 与 tee 命令
- Linux 输入\输出相关命令 echo read tee
- 同时输出屏幕和文件 linux命令tee
- 计算机视觉与图像处理
- Change the log files location of a WebLogic Domain
- AdNetwork、AdExchange、DSP、SSP、RTB、DMP广告名词解释
- Android WebDAV 客户端实现
- U盘中毒后被隐藏的文件夹无法隐藏选项无法取消
- [Shell]给linux命令tee输出文件加个时间
- [Mac 基础知识]:用Time Machine 恢复mac系统
- ASM(五) 利用TreeApi 解析生成及转换Class
- 面向对象语言的编译=====
- Change beasvc.exe default stdout log rotation parameters in WLS10.0
- zoj 3822 Domination
- 堆的建立
- 数据结构 树状数组
- 定护你一世周全 《大圣归来》影评剧透慎点