In above example, I did ls and pipe to “tee test” and again pipe to “wc -l”.
Output of ls when given to pipe it becomes standard input for another next process in our case tee which does copies it test file in addition to standard out which becomes standard input for wc command. The role of tee here to capture ouput of ls into test file in addition to passing it down to pipe for wc.
Enjoy!