Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 我如何替换单词“quot;”;“你好”;加上;再见;在这个目录中的每个文件中,也递归地?_Linux_Unix_Grep - Fatal编程技术网

Linux 我如何替换单词“quot;”;“你好”;加上;再见;在这个目录中的每个文件中,也递归地?

Linux 我如何替换单词“quot;”;“你好”;加上;再见;在这个目录中的每个文件中,也递归地?,linux,unix,grep,Linux,Unix,Grep,假设我在这个目录中有很多文件。我想用“再见”替换“你好”,也可以递归地查找-键入f-exec sed-i's/hello/bye/g'{}+作为$(find./)中的文件;执行sed-e's/hello/再见/g'$file>tmp&&mvtmp$file;完成您可以使用perl一行程序 perl -p -i -e 's/oldstring/newstring/g' `find ./ -name *.html` (取自此处)是否也更换子字符串?所有当前的答案将用“sgoodbyeut”替换“s

假设我在这个目录中有很多文件。我想用“再见”替换“你好”,也可以递归地查找-键入f-exec sed-i's/hello/bye/g'{}+

作为$(find./)中的文件;执行sed-e's/hello/再见/g'$file>tmp&&mvtmp$file;完成

您可以使用perl一行程序

perl -p -i -e 's/oldstring/newstring/g' `find ./ -name *.html`

(取自此处)

是否也更换子字符串?所有当前的答案将用“sgoodbyeut”替换“shellout”等词。我认为他们应该只处理代币替换。看看这个:我冒昧地修复了格式。。。基本的背景信号丢失。您可能需要检查该模式。您可能会得到sgoodbyeil的实例!