📜  echo 将行添加到文件 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:01.812000             🧑  作者: Mango

代码示例1
touch sample.txt 
echo "this is line one" > sample.txt  #adds this as first line
echo "this is line two" >> sample.txt #appends the line to sample.txt

#if you do echo "this will remain alone" > sample.txt
#    it will rewrite the sample.txt file with the string passed above