#!将文件b.txt加入到a.txt
#方法一
#sed -ne '1r b.txt' -e '1N;p' a.txt >a.tmp
#mv a.tmp a.txt
#rm -f a.tmp
#方法二
$echo b.txt|sed 's//(.*/)//1/' b.txt a.txt>a.tmp
mv a.tmp a.txt
rm -f a.tmp
#!将*.c文件类型修改为*.cpp
#for file in *.c;do
#mv $file ${file/.c/.cpp};
#rm -f $file.c
#done
本文介绍了两种实用的文本处理方法:一是如何使用sed命令将一个文件的内容追加到另一个文件的开头;二是批量更改文件扩展名的方法,这对于处理大量文件时特别有用。
2681

被折叠的 条评论
为什么被折叠?



