tee

Read from standard input and write to standard output and files (or commands).
More information.
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)
Copyright © 2014—present the tldr-pages team and contributors.
This work is licensed under the Creative Commons Attribution 4.0 International License (CC-BY).
CC-BY