Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.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 如何递归搜索某个文件并覆盖?_Linux_Shell_Recursion_Command Line_Copy - Fatal编程技术网

Linux 如何递归搜索某个文件并覆盖?

Linux 如何递归搜索某个文件并覆盖?,linux,shell,recursion,command-line,copy,Linux,Shell,Recursion,Command Line,Copy,Linux,命令行 我有一个文件名为file.txt。 它包含在特定路径(例如/path/)内的多个文件夹中。 例如,我有/path/folder1/file.tx和/path/folder2/folder/file.txt 我必须用/path2/中的新文件.txt替换所有这些事件。我也不确定您要在哪个环境中执行此操作。使用linux文件系统和工具,这应该可以: find/path-name file.txt-exec cp-rf/path2/file.txt{}使用什么编程语言?在哪个站台?

Linux,命令行

我有一个文件名为file.txt。 它包含在特定路径(例如/path/)内的多个文件夹中。 例如,我有/path/folder1/file.tx和/path/folder2/folder/file.txt


我必须用/path2/

中的新文件.txt替换所有这些事件。我也不确定您要在哪个环境中执行此操作。使用linux文件系统和工具,这应该可以:


find/path-name file.txt-exec cp-rf/path2/file.txt{}

使用什么编程语言?在哪个站台?