./configure 2>&1 | tee out.txt
configure 결과를 화면에 뿌리고 텍스트 파일에 저장한다

Read from an input and write to a standard output and file.

Syntax

tee [OPTION]... [FILE]...

-a
--append Append to the given FILEs, do not overwrite.
-i ignore interrupt signals.
--help Display the help screen.
--version Display the version.
Examples

ls *.txt | wc -l | tee /dev/tty count.txt

In the above example the ls command would list all .txt files in the current directory, take a word count (wc) by the amount of lines (-l) and the output displayed to the /dev/tty (terminal) will be sent to the count.txt.

Note: Because the above example did not take advantage of the -a or append option if the count.txt file already existed it would have been overwritten.

Related commands

cat


iPhone 에서 작성된 글입니다.
Posted by code cat