Linux 向文件中写入内容
2020-05-20 本文已影响0人
动动拐
1、创建文件
touch myfile.txt
2、写入文件内容(会覆盖原有内容)
echo 'this is first writing'>myfile.txt
3、向已有文件内容中追加内容
echo 'this is second writing'>>myfile.txt
touch myfile.txt
echo 'this is first writing'>myfile.txt
echo 'this is second writing'>>myfile.txt