一、批量在文件某行插入内容:
1 find -type f -name "*.pcf" |xargs sed -i '/aaaa/abbb/' 2 find -type f -name "*.pcf" |xargs sed -i '/aaaa/ibbb/'
其中a表示在包含"aaaa"的行后面一行加入"bbbb";i表示在前面一行加入。
二、批量替换文件内容:
1 find -type f -name "文件名" |xargs sed -i 's/aaaa/bbbb/g'
将文件中的aaaa替换成bbbb。
三、批量修改文件名:
1 rename "aaaa" "bbbb"
将文件名中的aaaa批量改成bbbb