Search code examples
bashstdouttee

Pipe to multiple files, but not stdout


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

Solution

  • You can simply use:

    echo 'hello world' | tee aa bb > cc