Regex Shell在所有文件及其文件夹、子文件夹中查找和替换域
我有一个域名Regex Shell在所有文件及其文件夹、子文件夹中查找和替换域,regex,linux,sed,Regex,Linux,Sed,我有一个域名 https://account.oldomain.com 我现在迁移到一个新域 https://account.newdomain.com 我想用account.newdomain.com替换account.olddomain.com的所有出现 我该怎么做 我知道我可以用像这样的东西 sed -i 's/account.oldomain.com/account.newdomain.com/g' /hello 但是sed:无法编辑/hello:不是常规文件 如何替换当前目录中的
https://account.oldomain.com
我现在迁移到一个新域
https://account.newdomain.com
我想用account.newdomain.com替换account.olddomain.com的所有出现
我该怎么做
我知道我可以用像这样的东西
sed -i 's/account.oldomain.com/account.newdomain.com/g' /hello
但是sed:无法编辑/hello:不是常规文件
如何替换当前目录中的所有文件及其目录(目录的子目录)以及当前文件夹中的所有文件和文件夹
with containing the text account.oldomain.com with account.newdomain.com
谢谢 试试看:
find /hello -type f|xargs sed -i 's#\(account[.]\)oldomain\([.]com\)#\1newdomain\2#g'
我更改您的
->[.]
,使其与点
完全匹配,而不是任何字符。尝试:
find /hello -type f|xargs sed -i 's#\(account[.]\)oldomain\([.]com\)#\1newdomain\2#g'
我更改您的
->[.]
,使其与点
完全匹配,而不是任何字符。尝试:
find /hello -type f|xargs sed -i 's#\(account[.]\)oldomain\([.]com\)#\1newdomain\2#g'
我更改您的
->[.]
,使其与点
完全匹配,而不是任何字符。尝试:
find /hello -type f|xargs sed -i 's#\(account[.]\)oldomain\([.]com\)#\1newdomain\2#g'
我更改您的
->[.]
,使其与点
完全匹配,而不是任何字符