Manual states that the tee is a \"pipe fitting\"-tool. The cases [1] confuse me:
1. case
echo \"foo bar\" | sudo tee -a /path/to/some/fi
Explanations for the Cases
1. the escalation of permissions with the sudo- and -tee commands
The example is not about just logic, rather convention. It shows the convention to escalate permissions:
echo "Body of file..." | sudo tee root_owned_file > /dev/null
This example shows tee being used to bypass an inherent limitation in the sudo command. sudo is unable to pipe the standard output to a file. By dumping its stdout stream into /dev/null, we also suppress the mirrored output in the console.
2. running sudo-commands with Vim
Since you can use Sudo-commands with Vim, you can use the command if you forgot to run as a sudo. It is useful in places such as /etc/init.d/, where you will find read-only files.
Logic with the tee-command
It is like a branch in Git, or better, please, see the T analogy by Rick Copeland. Hopefully, the modified example (original) helps to understand its use:
curl "http://en.wikipedia.org/wiki/Pipeline_(Unix)" | tee original_site | sed 's/[^a-zA-Z ]/ /g' | tr 'A-Z ' 'a-z\n' | grep '[a-z]' | sort -u | comm -23 - /usr/share/dict/words