Tee: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 7: Line 7:
The tee utility copies standard input to standard output, making a copy in zero or more files.
The tee utility copies standard input to standard output, making a copy in zero or more files.


something | tee ~/tmp/master.log
<syntaxhighlight lang='bash'>
something | tee ~/tmp/master.log
</syntaxhighlight>
 
To capture both stdout and stderr in the same file and send them both to stdout:
 
<syntaxhighlight lang='bash'>
something 2>&1 | tee ~/tmp/master.log
</syntaxhighlight>

Latest revision as of 20:23, 22 July 2020

Internal

Overview

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

something | tee ~/tmp/master.log

To capture both stdout and stderr in the same file and send them both to stdout:

something 2>&1 | tee ~/tmp/master.log