使用>>
来追加一个文件
echo "hello world" >> read.txt
cat read.txt
echo "hello siva" >> read.txt
cat read.txt
输出应为
hello world # from 1st echo command
hello world # from 2nd echo command
hello siva
使用>
来覆盖一个文件
echo "hello tom" > read.txt
cat read.txt
然后输出为
hello tom