Tee command, shell

Source: Internet
Author: User

Tee command, shell
Tee command

If you want to display the running command line output on the screen and redirect it to the file, the tee command can help you complete this task.

The usage mode is as follows:

[Cmd] | tee [cmd]. log


How to Use the LINUX Command TEE Function Description: Read standard input data and output its content into a file.

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

Note: The tee command reads data from the standard input device, outputs the data to the standard output device, and saves it as a file. We can use tee to save the data imported from the pipeline into a file, or even several files at a time.

Parameter:-a is appended to an existing file, rather than overwriting it. If the file name given the tee instruction already exists, the content of the file will be overwritten by default. After this parameter is added, the data is added at the end of the file content, and the original content is not deleted.

-I ignore the interrupt signal
-- Help Online help
-- Version: displays version information.

Example:
List the contents of the text file slayers. story and copy three copies of the file named ss-copy1, ss-copy2, and ss-copy3:

$ Cat slayers. story | tee ss-copy1 ss-copy2 ss-copy3
Shell tee command, annotation # Use find to find. /etc. /user/local. files in the/home Directory (-depth enables searching to finish searching the directory before entering the subdirectory) and back up these files to the/dev/rmt/On device using the cpio command, run the tee command to save the data to tape. log Files and output on the screen
Tee can output the input data stream to the screen and file at the same time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.