linux管道和tee命令

ps -ef | grep docker

等价于 ps -ef &> >(grep docker)

cat a.log | tee b.txt

等价于

cat a.log &> >(tee b.txt)

cat a.log | md5sum  > a.sum

为了将过程打印到屏幕

cat a.log | tee >(md5sum > a.sum)

从而

cat a.log |tee >(md5sum > a.sum) > b.txt

既可以对数据流做md5sum, 又可以做重定向

 cat a.log |tee >(md5sum > a.sum) | tee b.txt

md5sum + 屏幕打印 + 写文件

原文地址:https://www.cnblogs.com/mhc-fly/p/11352028.html