11.12 批量文本替换

1 grep "old" -rl ./ |xargs sed -i "s/old/new/g"

2 grep "Objbase.h" -rl . --include=.cpp --include=.h |xargs sed -i "s/Objbase.h/objbase.h/g"

3 或:sed -i "s/原字符串/新字符串/g" `grep 原字符串 -rl 所在目录

4 或:sed -i 's|ftp://old.url/|ftp://new.url/|g' some/filepath

5 举例:

6 grep "图像" -rl . --include=*.tex |xargs sed -i "s/图像/图象/g"

Copyright © DOSU community 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-09-12 13:04:39

results matching ""

    No results matching ""