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?
Asked
Active
Viewed 771 times
1 Answers
7
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.

cmenke
- 155
- 1
- 4
-
1I looked it up and the basic syntax is: command | tee file.txt – cmenke Dec 23 '11 at 08:50
-
And a merry christmas to you too! – Joel Dec 23 '11 at 10:36
-
5If you want to append to the file (instead of overwriting), use `command | tee -a file.txt` – Gordon Davisson Dec 23 '11 at 16:12