Linux Shell脚本入门:tee命令

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

示例二 使用tee命令重复输出字符串 [root@web ~]# echo 12345 | tee 12345 [root@web ~]# echo 12345 | tee – 12345 12345 [root@web ~]# echo 12345 | tee – – 12345 12345 12345 [root@web ~]# echo 12345 | tee – – – 12345 12345 12345 12345 [root@web ~]# echo 12345 | tee – – – – 12345 12345 12345 12345 12345 [root@web ~]# [root@web ~]# echo -n 12345 | tee 12345[root@web ~]# echo -n 12345 | tee – 1234512345[root@web ~]# echo -n 12345 | tee – – 123451234512345[root@web ~]# echo -n 12345 | tee – – – 12345123451234512345[root@web ~]# echo -n 12345 | tee – – – – 1234512345123451234512345[root@web ~]# 示例三 使用tee命令把标准错误输出也保存到文件 [root@web ~]# ls “*” ls: *: 没有那个文件或目录 [root@web ~]# ls “*” | tee – ls: *: 没有那个文件或目录 [root@web ~]# ls “*” | tee ls.txt ls: *: 没有那个文件或目录 [root@web ~]# cat ls.txt [root@web ~]# ls “*” 2>&1 | tee ls.txt ls: *: 没有那个文件或目录 [root@web ~]# cat ls.txt ls: *: 没有那个文件或目录 示例四 列出文本内容,同时复制3份复本 列出文本文件slayers.story的内容,同时复制3份副本,文件名称分别为ss-copy1、ss-copy2、ss-copy3: [root@web ~]# cat slayers.story |tee ss-copy1 ss-copy2 ss-copy3

[1][2]

做自己的决定。然后准备好承担后果。

Linux Shell脚本入门:tee命令

相关文章:

你感兴趣的文章:

标签云: