These are commands I type in the terminal
echo -e "First Line" | tee ~/output.log
echo -e "Second Line" | tee ~/output.logWhen I look in the file output.log I only see 'Second Line'. How can I make sure that tee appends (rather than wipes out the file)?
I'd like to be able to see this in the file:
First Line
Second LineShould I be approaching this another way?
01 Answer
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 overwriteNote: Using -a still creates the file mentioned.