https://blog.51cto.com/sunday208/1387054
linux用sed在文件最前面插入一行
如何在文件的最開頭插入一行字符串呢?
sed -i '1s/^/內容/' 文件名
例如:
sed -i '1s/^/#by Lflakf \n\n/' a.txt
===========================
我的
[root@ffcs211 xx]# ls *|xargs sed -i '1s/^/\/\/source file use encoding=\"GB18030\"\r\n/'
[root@ffcs211 xx]# cat a.txt
//source file use encoding="GB18030"