cmd1 | tee file.txt | cmd2

Category: I/O Redirection & Pipes

cmd1 | tee file.txt | cmd2

Tee output — write to file and continue pipeline

Splits the pipeline: writes the data to a file AND passes it along to the next command. tee is like a T-junction in plumbing.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.