天下脸皮共十分
我占八分

linux批量替换命令示例

sed -i 's/"https\:\/\/www.gitbook.com"/"http\:\/\/python.stephenyoung.top"/g' `grep -r "https://www.gitbook.com"`

find -name '*.html' | xargs perl -pi -e 's|https://www.gitbook.com|https://blog.ityoung.tech|g'

Published with GitBook

find -name '*.html' | xargs perl -pi -e 's|Published with GitBook|回到首页|g'

本書使用 GitBook 釋出

find -name '*.html' | xargs perl -pi -e 's|本書使用 GitBook 釋出|回到首页|g'

find -name '*.html' | xargs perl -pi -e 's|powered by Gitbook|powered by Stephen Young|g'

BigCat all right reserved
Stephen Young all right reserved

find -name '*.html' | xargs perl -pi -e 's|<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">|<link rel="shortcut icon" href="https://blog.ityoung.tech/b8888.ico" type="image/x-icon">|g'


find -name 'WordPress Theme by' | "WordPress Theme by"


find -name '*.php' | xargs perl -pi -e 's|WordPress Theme by|Stephen Young all right reserved|g'

find -name '*.php' | xargs perl -pi -e 's|find -name '*.php' | xargs perl -pi -e 's|<a href="https://superbthemes.com/"> Superbthemes</a>|Stephen Young all right reserved|g'|.|g'


find -name '*.php' | xargs perl -pi -e 's|<a href="https://superbthemes.com/"> Forever Young</a>|2019|g'

grep -rn "Forever Young" *
赞(0) 打赏
未经允许不得转载:Stephen Young » linux批量替换命令示例
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏