首页 > 系统服务 > 详细

linux系统中tee命令

时间:2021-07-10 16:12:44      阅读:21      评论:0      收藏:0      [点我收藏+]

tee命令将输出到屏幕上的内容保存至文件中。

1、

[root@centos7 test]# ls
[root@centos7 test]# seq 3
1
2
3
[root@centos7 test]# ls
[root@centos7 test]# seq 3 | tee a.txt
1
2
3
[root@centos7 test]# ls
a.txt
[root@centos7 test]# cat a.txt
1
2
3

 

2、同时保存多份

[root@centos7 test]# rm *
[root@centos7 test]# ls
[root@centos7 test]# seq 3 | tee a.txt b.txt c.txt
1
2
3
[root@centos7 test]# ls
a.txt  b.txt  c.txt
[root@centos7 test]# cat a.txt
1
2
3
[root@centos7 test]# cat b.txt
1
2
3
[root@centos7 test]# cat c.txt
1
2
3

 

linux系统中tee命令

原文:https://www.cnblogs.com/liujiaxin2018/p/14993720.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!