首页 > 系统服务 > 详细

Linux -- shell '>' and '>>' 的区别

时间:2020-06-18 21:32:20      阅读:41      评论:0      收藏:0      [点我收藏+]

在shell中

‘>‘  为创建: echo “hello shell”  > out.txt

‘>>‘ 为追加:echo “hello shell”  >> out.txt

当out.txt 文本不存在时,‘>‘与‘>>’都会默认创建out.txt文本,并将hello shell 字符串保存到out.txt中

当out.txt文本存在时,‘>’会将out.txt文本中的内容清空,并将hello shell 字符串存入

                                   而‘>>’会将 hello shell追加保存到out.txt的末尾

Linux -- shell '>' and '>>' 的区别

原文:https://www.cnblogs.com/gengyufei/p/13160026.html

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