These are commands I type in the terminal
echo -e "First Line" | tee ~/output.log
echo -e "Second Line" | tee ~/output.log
When 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 Line
Should I be approaching this another way?
tee
append to a new line? I.e., to append after first inserting a line break to ensure subsequent outputs are each on new lines. – wes Oct 17 '21 at 21:40printf '\n' | tee -a ~/output.log
– Stephen Quan Feb 23 '23 at 02:12