Linux tee命令


tee 從標準輸入讀取,並寫入標準輸出和文件


tee 命令參數

-a, --append                     追加附加到給定的文件,不要重寫

 -i, --ignore-interrupts      忽略中斷,忽略中斷信號

 --help                            幫助顯示此幫助並退出

--version                        版本輸出版本信息和退出

[root@localhost ~]# ll | tee -a ll.txt
total 20
-rw-------. 1 root root 1211 Feb 27  2017 anaconda-ks.cfg
-rw-r--r--. 1 root root 9458 Feb 27  2017 install.log
-rw-r--r--. 1 root root 3161 Feb 27  2017 install.log.syslog
-rw-r--r--  1 root root    0 Nov  7 17:58 ll.txt
[root@localhost ~]# cat ll.txt 
total 20
-rw-------. 1 root root 1211 Feb 27  2017 anaconda-ks.cfg
-rw-r--r--. 1 root root 9458 Feb 27  2017 install.log
-rw-r--r--. 1 root root 3161 Feb 27  2017 install.log.syslog
-rw-r--r--  1 root root    0 Nov  7 17:58 ll.txt
[root@localhost ~]# pwd | tee pwd.txt
/root
[root@localhost ~]# cat pwd.txt 
/root

查看tee命令版本

[root@svn ~]# tee  --version
tee (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, Richard M. Stallman, and David MacKenzie.

查看命令幫助

[root@svn ~]# tee --help
Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.

  -a, --append              append to the given FILEs, do not overwrite
  -i, --ignore-interrupts   ignore interrupt signals
      --help     display this help and exit
      --version  output version information and exit

If a FILE is -, copy again to standard output.

Report tee bugs to [email protected]
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'tee invocation'
[root@svn ~]# man tee
TEE(1)                           User Commands                          TEE(1)

NAME
       tee - read from standard input and write to standard output and files

SYNOPSIS
       tee [OPTION]... [FILE]...

DESCRIPTION
       Copy standard input to each FILE, and also to standard output.

       -a, --append
              append to the given FILEs, do not overwrite

       -i, --ignore-interrupts
              ignore interrupt signals

       --help display this help and exit

       --version
              output version information and exit

       If a FILE is -, copy again to standard output.

AUTHOR
       Written by Mike Parker, Richard M. Stallman, and David MacKenzie.

REPORTING BUGS
       Report tee bugs to [email protected]
       GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
       General help using GNU software: <http://www.gnu.org/gethelp/>
       Report tee translation bugs to <http://translationproject.org/team/>

COPYRIGHT
       Copyright  2010 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       The  full  documentation  for tee is maintained as a Texinfo manual.  If the info and tee programs are properly installed at your site,
       the command

              info coreutils 'tee invocation'


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章