English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux tee command

Linux Command大全

The Linux tee command is used to read data from the standard input and output its content as a file.

The tee command reads data from the standard input device, outputs its content to the standard output device, and saves it as a file.

Syntax

tee [-ai][--help][--version][file...]

Parameters:

  • -a or--append  Append to the end of the existing file instead of overwriting it.
  • -i or--ignore-interrupts  Ignore interrupt signals.
  • --help  Online help.
  • --version  Display version information.

Online Examples

Use the command "tee" to save the user's input data simultaneously to the file "file1" and "file2Enter the following command in "

$ tee file1 file2                   #Copy content in two files 

After executing the above commands, you will be prompted to enter the data to be saved to the file, as shown below:

My Linux                        #Prompt the user to enter data  
My Linux                        #Output data, for output feedback  

At this time, you can open the file "file" separately1" and "file2Check if the content is all "My Linux" to determine if the command "tee" has executed successfully.

Linux Command大全