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
tee
is used to split a command pipeline, allowing you to save the output of a command to a file and send it along down the pipeline. In the first example you gave::
echo "foo bar" | sudo tee -a /path/to/some/file
"foo bar" will be echoed to standard output and appended to /path/to/some/file
. Think of tee like a "T" joint in a pipe, splitting the output into two other pipes.