//echo后边用单引号包围要添加的内容 echo 'add content'>>/home/data/test.sh
注意>>表示在原来的文件末尾上进行追加,如果使用的是>则表示删除原来的内容之后再添加:
>>
>
echo 'add content'>/home/data/test.sh