Skip to content

Instantly share code, notes, and snippets.

@xylcbd xylcbd/useful.sh.md
Created Sep 18, 2018

Embed
What would you like to do?

批量替换目录中所有文件的字符串

sed -i "s/zhangsan/lisi/g" `grep zhangsan -rl /modules`

-i 表示inplace edit,就地修改文件
-r 表示搜索子目录
-l 表示输出匹配的文件名
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.