2

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 1

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.

3
  • 1
    I looked it up and the basic syntax is: command | tee file.txt
    – cmenke
    Commented Dec 23, 2011 at 8:50
  • And a merry christmas to you too!
    – Joel
    Commented Dec 23, 2011 at 10:36
  • 5
    If you want to append to the file (instead of overwriting), use command | tee -a file.txt Commented Dec 23, 2011 at 16:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .