首页 > 服务器 > Linux服务器 > 正文

Linux中实现文件内容替换的方法

2020-05-26 23:47:34
字体:
来源:转载
供稿:网友

要实现文本内容替换我们可以使用find和perl方法

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文件),用此方法替换

 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表