Get the App
SLTechnology News&Howtos  ›  Servers  › 

The use of tee instruction under unix

Shulou Source: shulou.com Published: 2022-06-03 08:48:54 09月21日 Update

In ordinary times, the use of output redirection is to use ">" and "> >" to specify the contents that need to be output to a file, the former if the specified file already exists, then the file will be rewritten; the latter is appended, append the content to the end of the file to save, these two methods can not redirect the content to be displayed on the screen. However, there are times when you need to redirect screen viewing information or redirect a content to multiple files, so use the tee directive to get the following parameter options through man help:

-a: use append mode when redirecting to a file;-I: ignore interrupt signals.

It is not difficult to understand that-a has the same effect as "> >".-I means that the interrupt signal is not being received. When we use tee output redirection, we will not receive invalid termination signal when we use [Ctrl] c. We can only use [Ctrl] d to send EOF termination. If we need to redirect a content to multiple files, we can write like this:

[root@jim data] # cat file | tee file1 file2

Tags: File content signal output multiple screen instruction share information parameter that is meaning effect method time end mode face bulk weight help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Shulou Information Docker macOS