jerryfleming 发表于 2006-5-9 12:17:58

bash重定向到两个地方怎么做?

例如,我想把stdout复制到LOG文件中,同时在屏幕上(标准的stdout)还要看到结果。
ls > log
上面的命令只实现了第一个要求。
ls 1>& log
也不行的。

aries1998 发表于 2006-5-9 14:18:26

tee

zhy2111314 发表于 2006-5-9 14:20:01

ls |tee log

jerryfleming 发表于 2006-5-10 11:46:25

谢谢。

BOoRFGOnZ 发表于 2006-5-10 13:24:21

tee - read from standard input and write to standard output and files :-D
页: [1]
查看完整版本: bash重定向到两个地方怎么做?