Tuesday, October 18, 2011

tee command in linux


Redirecting the output (standard output = stdout) of the program both to the file and to the screen:

program | tee outputfile.txt

Forcing both the standard error and the standard output to be written in the file:

program 2>&1 | tee outputfile.txt

Appending into the file instead of rewriting it:

program | tee -a outputfile.txt


No comments:

Post a Comment