linux下批量正则查找替换文本文件内容

三 2nd, 2010
find -name '*.html' | xargs perl -pi -e 's|href="(.*\.html)"|href="/html/$1"|g'

如上所示为我在所有形如xxx.html前加上/html/
正则查找,非常灵活方便。留帖备忘

标签: ,
  1. 淘宝
    七 15th, 201014:06

    这一篇写得很不错,受益匪浅,支持你!

;) :| :x :twisted: :roll: :oops: :o :mrgreen: :lol: :idea: :evil: :cry: :arrow: :P :D :?: :? :) :( :!: 8O 8)

Spam Protection by WP-SpamFree