Purpose:Copy standard input to both standard output and a file

 

Format:TEE [/A /Dn /F"format" /R /T] file...

 

fileOne or more files that will receive the "tee-d" output.

 

/A(ppend)/R (STDERR)
/D(ate)/T(ime)

/F"..." (format)

 

See also: Y, piping and redirection.

 

Usage:

 

TEE is normally used to "split" the output of a program so that you can see it on the display and also save it in a file. It can also be used to capture intermediate output before the data is altered by another program or command.

 

TEE gets its input from standard input (usually the piped output of another command or program), and sends out two copies: one to standard output, the other to the file(s) that you specify. TEE is not likely to be useful with programs which do not use standard output, because these programs cannot send output through a pipe.

 

If you are typing at the keyboard to produce the input for TEE, you must enter a Ctrl-Z to terminate the input.

 

See Piping for more information on pipes.

 

Example:

 

Search the file DOC for any lines containing the string Take Command, make a copy of the matching lines in TC.DAT, sort the lines, and write them to the output file TCS.DAT:

 

ffind /t"Take Command" doc | tee tc.dat | sort > tcs.dat

 

Options:

 

/AAppend to the file(s) rather than overwriting them.

 

/DPrefix each line with the current date (in yyyy-mm-dd format).

 

/F"..."The format string. See @DATEFMT for details on format arguments.

 

/RRedirect to STDERR instead of STDOUT.

 

/TPrefix each line with the current time (in hh:mm:ss.ms format).