The specific usage of the tee command in Linux system

  
                

The tee command in Linux is mainly used to save the data imported by the pipeline into a file. So what is the actual application of the tee command? The following will give you a detailed introduction to the use of the Linux tee command.

tee

Function Description: Reads standard input data, and outputs it to the contents of the file.

Syntax: tee [-ai][--help][--version][file…]

Supplement: The tee command reads data from a standard input device and puts it The content is output to a standard output device and saved as a file. We can use tee to save the data imported by the pipeline into a file, and even save several files at a time.

Parameter: -a Appends to the existing file instead of overwriting it. If the file name given to the tee command already exists, the preset will overwrite the contents of the file. With this parameter added, the data will be added at the end of the file's content without deleting the original content.

-i Ignore interrupt signals

--help Online help

--version Display version information

Example:

List Copy the contents of the text file slayers.story and copy 3 copies at the same time. The file names are ss-copy1, ss-copy2, ss-copy3:

$ cat slayers.story

Copyright © Windows knowledge All Rights Reserved