标签: bash shell
如何使用tee的管道写入文件并显示到屏幕?
tee
这个命令实际上是这样做的,问题是它写入一个新文件而tail -f给我一个错误“截断文件”。
tail -f
ls -al | tee file.txt
答案 0 :(得分:0)
-a tee选项
-a
-a, --append append to the given FILEs, do not overwrite
所以你的行将是:
ls -al | tee -a file.txt