tee命令使用

需求描述:nginx

  今天在看nginx内容的过程,遇到了tee这个命令,因此查询了下,在这里记录下使用方法.app

操做过程:this

1.执行如下的命令orm

[root@testvm ~]# uname -n | tee hostInfo
testvm
[root@testvm ~]# cat hostInfo 
testvm

备注:经过以上的执行能够知道,tee命令是从标准输入读取内容,而后将读取到的内容写到标准输出和指定的文件.因此,在屏幕中出现了uname -n的结果,文件中也存有该信息.blog

 2.tee命令的使用方法get

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 bug-coreutils@gnu.org
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'

小结:input

  tee命令的做用将输入的内容写入到屏幕和文件,输入屏幕的做用是查看,前面命令的执行结果是不是本身想要的.it

相关文章
相关标签/搜索