How to append tee to a file in Bash?
Solution 1:
echo -e "First Line" | tee ~/output.log
echo -e "Second Line" | tee -a ~/output.log
^^
From man tee:
Copy standard input to each FILE, and also to standard output.
-a, --append
append to the given FILEs, do not overwrite
Note: Using -a
still creates the file mentioned.