Bash 使用find with rsync将具有word语法的文件复制到另一个位置/目录

Bash 使用find with rsync将具有word语法的文件复制到另一个位置/目录,bash,shell,find,rsync,Bash,Shell,Find,Rsync,我想创建一个脚本,以增量方式将文件从目录a复制到目录AB、AC、AD等 例如,我在目录A中有一些文件,如world_test.txt,world1_test.txtworld2_test.txt。我想将所有名为world\u test的文件复制到文件夹AB,依此类推 我尝试了下面的脚本,但失败了 find /path/ -name "world_test" -type f | xargs -i rsync ... {} /var/AB \; 有人能修改脚本或建议另一个命令吗?下面的命令对我有用

我想创建一个脚本,以增量方式将文件从目录a复制到目录AB、AC、AD等

例如,我在目录A中有一些文件,如
world_test.txt
world1_test.txt
world2_test.txt
。我想将所有名为
world\u test
的文件复制到文件夹AB,依此类推

我尝试了下面的脚本,但失败了

find /path/ -name "world_test" -type f | xargs -i rsync ... {} /var/AB \;

有人能修改脚本或建议另一个命令吗?

下面的命令对我有用


找到-键入f-name'file name'-exec rsync-aR'{}'/文件夹名\

为什么不正确使用
rsync
rsync-ua/path/to/world\u test**/newpath
?(注意,您可以根据需要调整选项)您好,David,源文件夹中有数千个不同名称的文件,因此我需要先找到这些文件,然后再进行rsync到destination创建列表,然后为每个文件调用
rsync
时遇到的问题,您将调用
rsync
数千次,而不是找到一个通配符,允许您为许多文件调用
rsync
一次。