> & >>
>创建1
$ echo "hello shell" > output.txt
>>追加1
$ echo "hello shell" >> output.txt
当output.txt不存在时,两者都会创建一个新的output.txt;
当output.txt存在时,前者会清空并重新写入,后者怎会在末尾追加
ref: https://blog.csdn.net/nahanai/article/details/83861449
> 创建1 | $ echo "hello shell" > output.txt |
>> 追加1 | $ echo "hello shell" >> output.txt |
当output.txt不存在时,两者都会创建一个新的output.txt;
当output.txt存在时,前者会清空并重新写入,后者怎会在末尾追加
ref: https://blog.csdn.net/nahanai/article/details/83861449