tee command in Linux with examples
tee command reads the standard input and writes it to both the standard output and one or more files. The command is named after the T-splitter used in plumbing. It basically breaks the output of a program so that it can be both displayed and saved in a file. It does both the tasks simultaneously, copies the result into the specified files or variables and also display the result.
tee [OPTION]... [FILE]...
1.-a Option : It basically do not overwrite the file but append to the given file.
Suppose we have file1.txt
Input: geek for geeks