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

相關文章
相關標籤/搜索