分类: LINUX
tee 一个linux下把数据同时写到屏幕和文件的常用工具
标题里面写屏幕是便于理解 其实就是写到标准输出
read from standard input and write to standard output and files
一个常用的参数是 -a
-a, --append
append to the given FILEs, do not overwrite
就是说不覆盖文件 而是追加到文件
用武之地在于:
想追一个东西 又怕一时看不完或者追不到
就算是又要能实时看到 又要能写到文件便于以后查看
可以同时写到多份文件里面
比如编译软件的过程可以
./configure | tee -a log.configure.log
make | tee -a log.configure.log
标题里面写屏幕是便于理解 其实就是写到标准输出
read from standard input and write to standard output and files
一个常用的参数是 -a
-a, --append
append to the given FILEs, do not overwrite
就是说不覆盖文件 而是追加到文件
用武之地在于:
想追一个东西 又怕一时看不完或者追不到
就算是又要能实时看到 又要能写到文件便于以后查看
可以同时写到多份文件里面
比如编译软件的过程可以
./configure | tee -a log.configure.log
make | tee -a log.configure.log
即,既能实时看,又能写入日志文件。