linux怎么将文件内容添加到另一个文件的前面

如题所述

使用重定向就可以了,比如有a,b两个文件,你需要将a文件内容追加到b文件的前面,实际就是b文件的内容放到a文件的后面,命令:cat b >> a
温馨提示:答案为网友推荐,仅供参考
第1个回答  2020-03-10
cat file1 file2 > temp
cat temp > file2
将file1的内容添加到file2的开头,temp是中间文件
第2个回答  2016-12-12
cat a.txt > b.txt
相似回答