我的 Ubuntu 服务器上有一个很大的 WordPress SQL 转储文件,大约 7GB。由于我正在更改域,因此我需要替换文件中的域名。我想知道如何通过命令行来做到这一点。
dev.example.com
Run Code Online (Sandbox Code Playgroud)
需要替换为
example.com
Run Code Online (Sandbox Code Playgroud)
小智 7
您可以将 sed 与就地编辑一起使用
sed -i -e 's/dev\.example\.com/example\.com/g' filename
Run Code Online (Sandbox Code Playgroud)