zoukankan      html  css  js  c++  java
  • tee命令详解

    基础命令学习目录首页

    参考:http://man.linuxde.net/tee

    tee命令用于将数据重定向到文件,另一方面还可以提供一份重定向数据的副本作为后续命令的stdin。简单的说就是把数据重定向到给定文件和屏幕上。

    存在缓存机制,每1024个字节将输出一次。若从管道接收输入数据,应该是缓冲区满,才将数据转存到指定的文件中。若文件内容不到1024个字节,则接收完从标准输入设备读入的数据后,将刷新一次缓冲区,并转存数据到指定文件。

    [root@mayun /root/mcw] test!
    #ls
    a.txt  diff.txt  hostbuji.sh  mcwpaixu.txt  quanji.txt  te.txt  ziji.txt
    [root@mayun /root/mcw] test!
    #cat te.txt
    a.txt
    diff.txt
    hostbuji.sh
    mcwpaixu.txt
    quanji.txt
    ziji.txt
    [root@mayun /root/mcw] test!
    #
    [root@mayun /root/mcw] test!
    #cat a.txt
    wo shi mcw, nihao
    how do you do
    魔降风云变
    i want to go to school by bus.
    [root@mayun /root/mcw] test!
    #cat a.txt |tee te.txt
    wo shi mcw, nihao
    how do you do
    魔降风云变
    i want to go to school by bus.
    [root@mayun /root/mcw] test!
    #cat te.txt
    wo shi mcw, nihao
    how do you do
    魔降风云变
    i want to go to school by bus.
  • 相关阅读:
    C#异步编程
    3.TinkPHP中的模型
    Socket网络编程
    日志查看登录用户
    ssh相关的设置
    爬虫学习笔记
    python升级到3.*版本
    Redis未授权访问攻击过程与防范
    Linux重置MySQL密码
    linux下WordPress安装
  • 原文地址:https://www.cnblogs.com/machangwei-8/p/9572146.html
Copyright © 2011-2022 走看看