系统吧 专业的电脑操作系统,支持重装各种原版系统xp/win7/win8/win10 这个系统怎么样?试试系统吧系统,体验办公系统畅快愉悦感。 各种电脑系统安装过程一样,神一般的畅快!
-->
当前位置:主页 > win8 >

Linux系统中tee命令的具体使用解决方法(2)

作者:王美芳 分类:win8 发布时间:2023-01-11 07:36:00

1 2 3 4 5 [[email protected] ~]# cat 2.txt 1 2 3 4 5 [[email protected] ~]# cat 3.txt 1 2 3 4 5 [[email protected] ~]# cat 1.txt 》》2.txt [[email protected] ~]# cat 1.txt | tee...

  1

  2

  3

  4

  5

  [[email protected] ~]# cat 2.txt

  1

  2

  3

  4

  5

  [[email protected] ~]# cat 3.txt

  1

  2

  3

  4

  5

  [[email protected] ~]# cat 1.txt 》》2.txt

  [[email protected] ~]# cat 1.txt | tee -a 3.txt

  1

  2

  3

  4

  5

  [[email protected] ~]# cat 2.txt

  1

  2

  3

  4

  5

  1

  2

  3

  4

  5

  [[email protected] ~]# cat 3.txt

  1

  2

  3

  4

  5

  1

  2

  3

  4

  5

  [[email protected] ~]#

  示例二 使用tee命令重复输出字符串

  [[email protected] ~]# echo 12345 | tee

  12345

  [[email protected] ~]# echo 12345 | tee -

  12345

  12345

  [[email protected] ~]# echo 12345 | tee - -

  12345

  12345

  12345

  [[email protected] ~]# echo 12345 | tee - - -

  12345

  12345

  12345

  12345

  [[email protected] ~]# echo 12345 | tee - - - -

  12345

  12345

  12345

  12345

  12345

  [[email protected] ~]#

  [[email protected] ~]# echo -n 12345 | tee

  12345[[email protected] ~]# echo -n 12345 | tee -

  1234512345[[email protected] ~]# echo -n 12345 | tee - -

  123451234512345[[email protected] ~]# echo -n 12345 | tee - - -

  12345123451234512345[[email protected] ~]# echo -n 12345 | tee - - - -

  1234512345123451234512345[[email protected] ~]#

  示例三 使用tee命令把标准错误输出也保存到文件

  [[email protected] ~]# ls “*”

  ls: *: 没有那个文件或目录

  [[email protected] ~]# ls “*” | tee -

  ls: *: 没有那个文件或目录

  [[email protected] ~]# ls “*” | tee ls.txt

  ls: *: 没有那个文件或目录

  [[email protected] ~]# cat ls.txt

  [[email protected] ~]# ls “*” 2》&1 | tee ls.txt

  ls: *: 没有那个文件或目录

  [[email protected] ~]# cat ls.txt

  ls: *: 没有那个文件或目录

  [[email protected] ~]#

  上面就是Linux下tee命令的用法介绍了,通过实例我们将更好的理解该命令的作用,并灵活用于实际当中,你学会了吗,想了解更多内容可以对电脑系统吧进行关注!

xp 更多>>
win7 更多>>
win8 更多>>
win10 更多>>
U盘 更多>>
电脑技术 更多>>
网站地图 | 豫ICP备2021035069号-4 | 友情链接qq:191064436
系统吧

版权所有 © 2012-2023 系统吧 免责声明:本站资源均收集于互联网,其著作权归原作者所有,如果有侵犯您权利的资源,请来信告知,我们将及时删除相应资源。