Command tee writes the standard output and copies it into the specified file or files. Use the tee command to view your output immediately and at the same time, store it for future use.
For example, the following will display the out and write to the ziabs.txt file ls | tee ziabs.txt If we want copy to the multiple file just pass the file names in sequence ps -aux | tee ziabs.txt ps.log
tee with append option
We can use tee with append option for that need to pass the -a flag ls | tee -a ziabs.txt