zoukankan      html  css  js  c++  java
  • tee命令使用

    需求描述:

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

    操作过程:

    1.执行以下的命令

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

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

     2.tee命令的使用方法

    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'

    小结:

      tee命令的作用将输入的内容写入到屏幕和文件,输入屏幕的作用是查看,前面命令的执行结果是否是自己想要的.

  • 相关阅读:
    MySQL索引底层的实现
    mysql索引深入优化
    explain详解与索引最佳实践
    (MYSQL)回表查询原理,利用联合索引实现索引覆盖
    为什么重复值高的字段不能建索引(比如性别字段等)
    Spring的事务
    为什么要用Redis?Redis为什么这么快?
    spring AOP
    钩子教程
    钩子教程
  • 原文地址:https://www.cnblogs.com/yorkyang/p/10082844.html
Copyright © 2011-2022 走看看