Read from
stdin
and write tostdout
and files (or commands). More information: https://www.gnu.org/software/coreutils/tee.
stdin
to each file, and also to stdout
:echo "example" | tee path/to/file
echo "example" | tee -a path/to/file
stdin
to the terminal, and also pipe it into another program for further processing:echo "example" | tee /dev/tty | xargs printf "[%s]"
echo "example" | tee >(xargs mkdir) >(wc -c)