需求描述:

  今天在看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命令的作用将输入的内容写入到屏幕和文件,输入屏幕的作用是查看,前面命令的执行结果是否是自己想要的.

tee命令使用的更多相关文章

  1. tee命令

    tee命令 http://liubin.blog.51cto.com/282313/131298 https://en.wikipedia.org/wiki/Tee_(command)

  2. tee 命令基本使用方法、输出到多个文件

    功能说明:读取标准输入的数据,并将其内容输出成文件.语  法:tee [-ai][--help][--version][文件...]补充说明:tee指令会从标准输入设备读取数据,将其内容输出到标准输出 ...

  3. Linux Shell脚本入门:tee命令

    用途说明   在执行Linux命令时,我们可以把输出重定向到文件中,比如 ls >a.txt,这时我们就不能看到输出了,如果我们既想把输出保存到文件中,又想在屏幕上看到输出内容,就可以使用tee ...

  4. linux tee 命令详解

    man tee: NAME tee - read from standard input and write to standard output and files SYNOPSIS tee [OP ...

  5. mysql tee 命令

    tee 命令说明: 用过mysql的应该都会知道mysql有一个叫show 的命令,这个命令应该是SQL标准之外的一个扩展:和这个类似mysql还扩展了一个叫tee的命令. tee的功能是把你的所有输 ...

  6. Linux tee命令详解

    Linux tee命令 Linux tee命令用于读取标准输入的数据,并将其内容输出成文件.如果文件指定为"-",则将输入内容复制到标准输出 tee指令会从标准输入设备读取数据,将 ...

  7. Mysql 将结果保存到文件 从文件里运行sql语句 记录操作过程(tee 命令的使用)

    1.  有时候我们可能须要记录我们对mysql的操作过程,这时我们能够使用mysql的tee命令 1)第一种情况是在链接数据库的时候使用tee >mysql  -u root  -p  --te ...

  8. tee命令详解

    基础命令学习目录首页 参考:http://man.linuxde.net/tee tee命令用于将数据重定向到文件,另一方面还可以提供一份重定向数据的副本作为后续命令的stdin.简单的说就是把数据重 ...

  9. linux系统中,tee命令的使用

    需求描述: 今天在看nginx内容的过程,遇到了tee这个命令,所以查询了下,在这里记录下使用方法. 操作过程: 1.执行以下的命令 [root@testvm ~]# uname -n | tee h ...

随机推荐

  1. en-zh(科学技术)science and technology-2

    研究:长期不吃早餐,患心脏病风险增加87% Skipping breakfast could raise risk of heart disease by 87% Skipping breakfast ...

  2. Create-React-App创建antd-mobile开发环境

    Facebook 官方推出Create-React-App脚手架,基本可以零配置搭建基于webpack的React开发环境,内置了热更新等功能. 详细文档可前往链接:Create-React-App文 ...

  3. VUE 安装&创建一个项目

    1,安装node.js vue依赖nodejs,所以首先要安装node.js 然后打开cmd,输入命令, node -v.正常出现版本号,说明你已经安装成功了 下载地址:http://nodejs.c ...

  4. sizeof操作符的一些例子

    例一: #include <iostream> using namespace std; class A { public: char c; }; class B { public: in ...

  5. vueX、vue中transition的使用、axios

    引入一篇好文章链接:看一遍就会的vuex文章;完!!! vue中transtion的使用:transition文章;完!!! axios的文章:axios;完!!!

  6. TZOJ 4493: Remove Digits

    4493: Remove Digits 时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte 总提交: 329            测试通过:77 描述 G ...

  7. django 缓存信号等

    参考别人的博客:写的挺好 http://www.cnblogs.com/wupeiqi/articles/5246483.html

  8. 未能执行URL

    在 <compilation debug="true"> 下 加入: <buildProviders> <add extension=".h ...

  9. Win10 +gtx1660 +CUDA10.0+CNDNN7.5+Tensorflow 1.13.1

    硬件环境:ASUS Z370 + i7 8700K + 16G + GTX1660 软件环境:win10 x64    anaconda 3.5    python 3.6   pycharm 201 ...

  10. [Freemarker]自定义时间戳函数

    使用freemarker的web项目经常需要用在Url后面加上时间戳来保证资源不被缓存,我们可以自定义方法实现时间戳. 先看freemarker配置信息: <bean id="free ...