返回顶部

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

在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的末尾

posted @ 2020-06-18 21:07  Be-myself  阅读(485)  评论(0编辑  收藏  举报
levels of contents 点击查看具体代码内容