Name: Tee
Location:/usr/bin/tee
Permissions: All Users
Role: Bidirectional redirection, the data stream will be sent with the file and the screen, and output to the screen is stdout, you can let the next command to continue processing.
Usage: tee [OPTION] ... [FILE] ...
Options:
-A,--append append to the given FILEs, does not overwrite
Additional
bidirectional redirection, which can also be output to the screen after writing the file last.list.
Last |tee last.listcwjy1202 pts/0:0 Sat Jan 22:14 still logged in reboot system boot 3.2.0-24-generic Sat Jan 21:45-23:02 (01:16) cwjy1202 pts/0:0.0 Sat Jan 19:24-down (00:00) reboot system boot 3.2.0-24-generic Sat Jan 10 14:17 -19:24 (05:07) reboot system boot 3.2.0-24-generic Fri Jan 9 20:50-22:50 (01:59) cwjy1202 pts/0:0 Thu Jan 8 22:08-23:16 (01:08) reboot system boot 3.2.0-24-generic Thu Jan 8 21:45-23:17 (01:31 ) cwjy1202 PTS/2:0 Wed Jan 7 23:22-00:27 (01:05) cwjy1202 pts/0:0 Wed Jan 7 23:04-00:27 (01:23) reboot system boot 3.2.0-24-generic Wed Jan 7 23:03-00:27 (01:23) cwjy1202 PTS/2:0 Tue Jan 6 23:10-23:46 (00:36) cwjy1202 pts/0:0 Tue Jan 6 22:32-23:46 (01:13) reboot system boot 3.2.0-24-generic Tue Jan 6 19:32-23:46 (04:cwjy1202 pts/0:0 Tue Jan 6 00:24-00:46 (00:21) reboot system boot 3.2.0-24-generic Mon Jan 5 20:59-00:46 (03:47) cwjy1202 pts/0:0 Sat Jan 3 20:33-00:39 (04:06) cwjy1202 pts/0:0 Sat Jan 3 19:23-19:24 (00:00) reboot system boot 3.2.0-24-generic Sat Jan 3 19:12-00:41 (05:28) cwjy1202 PTS/2:0 Sat Jan 3 14:58-17:04 (02:05) cwjy1202 pts/1:0 Sat Jan 3 14:57-17:04 (02:07) reboot system boot 3.2.0-24-generic Sat Jan 3 14:54-17:05 (02:10) wtmp Begi NS FRI Jan 2 17:17:32 2015
Note: The tee command on the name and
No Add option -ASo that the default file will be overwritten.
In the following example, the last information is written to the file Last.list and can also be processed by the SED command
$ Last |tee-a last.list| sed-n ' 1p ' cwjy1202 pts/0 : 0 Sat Jan 10 22:14
The Tee for Linux commands