Data transmission during Linux Command Execution is as follows:
1) standard input (stdin): the code is 0, use <or <;
2) standard output (stdout): the code is 1, use> or>;
3) standard error output (stderr): Code 2, Use 2> or 2>;
> Indicates writing data to a file or device in overwriting mode,> indicates writing data to a file or device in accumulative mode.
<Indicates to replace the data originally required by the keyboard with the file content, and <indicates to end the input. For example, if I want to use cat to directly output the input information to the catfile, and the end ends when the keyboard inputs eof, then:
# Cat> catfile <EOF> This is a test> OK> EOF
Tee-two-way redirection From the above we can know that the data stream is either output to a file or device, or output to the screen (that is, standard output), and the tee command can achieve the goal of simultaneous output:
Tee allows the standard output to be transferred to a file. Its usage is as follows:
Tee [-a] file-a: Accumulate ls-l/home | tee homefile | more