美文网首页
每天一个Linux命令:tee

每天一个Linux命令:tee

作者: BlackChen | 来源:发表于2017-03-19 22:18 被阅读55次

tee

前几天电脑坏了。。。尴尬

tee - read from standard input and write to standard output and files
从标准输入读取信息,并且输出到标准输出和文件

cc@MyLinux:~/test$ who |tee a.file
cc       tty1         2017-03-19 07:01
cc       pts/0        2017-03-19 07:02 (192.168.254.1)
cc@MyLinux:~/test$ cat a.file
cc       tty1         2017-03-19 07:01
cc       pts/0        2017-03-19 07:02 (192.168.254.1)
  • -a 追加,不清空原来文件中的信息
cc@MyLinux:~/test$ pwd |tee -a a.file
/home/cc/test
cc@MyLinux:~/test$ cat a.file
cc       tty1         2017-03-19 07:01
cc       pts/0        2017-03-19 07:02 (192.168.254.1)
/home/cc/test
cc@MyLinux:~/test$ who |tee b.file
  • 用tee生成文件
cc@MyLinux:~/test$ tee test.c
#include <stdio.h>
#include <stdio.h>


int main()
int main()
{
{
        printf("hello tee\n"); 
    printf("hello tee⛮");
    return 0;
    return 0;
}
}
^C
cc@MyLinux:~/test$ 

cc@MyLinux:~/test$ cat test.c 
#include <stdio.h>

int main()
{
    printf("hello tee⛮");
    return 0;
}

相关文章

  • Linux命令之文件管理 (三十八)

    Linux tee命令 Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。 tee指令会从标准输...

  • Linux tee命令

    Linux tee命令 Linux tee命令用于读取标准输入的数据,并将其内容输出成文件。 tee指令会从标准输...

  • linux 终端打印内容输出到文件

    方法:利用tee命令可将linux终端的打印内容输出到文件 示例:ifconfig | tee ifconfig....

  • 每天一个Linux命令:tee

    tee 前几天电脑坏了。。。尴尬 tee - read from standard input and write...

  • linux命令 tee

    tee 从标准输入读取数据并重定向到标准输出和文件在输出到控制台的同时输入到文件 选项 例子? 注意 存在缓存机制...

  • Linux tee 命令

    我们一定有着这样的烦恼,使用 Linux 中的命令写入文件的时候,控制台是不显示写入的内容,往控制台写入内容的时候...

  • 每天一个Linux命令之tee

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

  • Linux 命令之 tee

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

  • Linux的tee命令

    文章作者:Tyan博客:noahsnail.com | CSDN | 简书 Linux的tee命令可以将输出同时发...

  • Linux命令之tee

    tee 该命令从标准输入读取数据然后写入到标准输出和文件中。 wpa_passphrase "testing" |...

网友评论

      本文标题:每天一个Linux命令:tee

      本文链接:https://www.haomeiwen.com/subject/hxacnttx.html