Linux 输出重定向>和>>的区别是什么

2025-02-14 23:05:49
推荐回答(1个)
回答(1):

> 清空文件再写入
>> 追加写入
比如文件file.txt 内容:
sampe text.
echo hello > file.txt
文件内容变成:
hello
echo hello >> file.txt
文件内容变成:
sample text
hello