Pipe to multiple files, but not stdout

Steven Penny picture Steven Penny · Mar 7, 2013 · Viewed 8.1k times · Source

I want to pipe stdout to multiple files, but keep stdout itself quiet. tee is close but it prints to both the files and stdout

$ echo 'hello world' | tee aa bb cc
hello world

This works but I would prefer something simpler if possible

$ echo 'hello world' | tee aa bb cc >/dev/null

Answer

anishsane picture anishsane · Mar 7, 2013

You can simply use:

echo 'hello world' | tee aa bb > cc