搜索和在linux目录下的所有文件替换文本

问题描述:

我有,我需要改变从一个域到另一个硬盘的所有codeD链接一个网站目录。寻找一个(grep的?sed的?)bash命令,让我来更改文本中所有出现的所有目录中的文件?

I have a website directory where I need to change all hardcoded links from one domain to another. Looking for a single (grep? sed?) bash command that will allow me to change all occurrences of text in all files in the directory?

下面将做到这一点:

sed -i 's/old_link/new_link/g' file...

不要忘了逃跑的斜线,点,并在链接地址的任何其他正则表达式特殊字符用反斜杠。

Don't forget to escape any slashes, dots, and any other regex special chars in the link addresses with a backslash.