> 和 >> 符号

> 表示把'>'左边的内容覆盖到'>'右边

比如有一个文件aaa.txt

echo 'Hello world' > aaa.txt

aaa.txt的内容则被完全覆盖为新的内容:

Hello world
echo 'Hello again' >> aaa.txt

aaa.txt会追加新的内容到文件末尾

Hello world
Hello again

合并文件

cat part1.txt part2.txt > all.txt

results matching ""

    No results matching ""