Is it possible to redirect output to multiple devices?

Is it possible to redirect output to multiple devices/files?

program.exe 1> output1.txt 1>output2.txt

This only produces output2.txt in Windows.

Answer

tee is a command that offers you the flexibility on *nix machines to redirect output to multiple files.

From the man page –

DESCRIPTION
     The tee utility copies standard input to standard output, 
making a copy in zero or more files.  The output is unbuffered.

On Windows, you can use something similar to this.

Attribution
Source : Link , Question Author : ShyMan , Answer Author : jaypal singh

Leave a Comment