Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of tee instruction under unix

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report