On linux/bash I'd like to append stdout of a command to a file, but not redirect it (i.e. I want it to to go to both console and file). Any clues?
1 Answer
I think "tee" is the right command for this -- unfortunately I don't know the exact syntax. Tee writes its input to stdout and to a file.
-
1I looked it up and the basic syntax is: command | tee file.txt– cmenkeCommented Dec 23, 2011 at 8:50
-
-
5If you want to append to the file (instead of overwriting), use
command | tee -a file.txt
Commented Dec 23, 2011 at 16:12