tee Command Examples

Read from stdin and write to stdout and files (or commands). More information: https://www.gnu.org/software/coreutils/tee.

echo "example" | tee {{path/to/file}}

echo "example" | tee -a {{path/to/file}}

echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}

echo "example" | tee >(xargs mkdir) >(wc -c)