歡迎您光臨本站 註冊首頁

Linux下利用find和perl正則替換文件內容

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

  find -name 'xixi.php' |xargs perl -pi -e 's|hello|aa|g'

  find -name '*.html' |xargs perl -pi -e 's|aa|hello|g'

  find -name '*.html' |xargs perl -pi -e 's|<script src="a.js([^>]*)></script>||g'

  Linux 當大批文件被掛馬時(掛js文件),用此方法替換.


[火星人 ] Linux下利用find和perl正則替換文件內容已經有551次圍觀

http://coctec.com/docs/linux/show-post-51120.html