【发布时间】:2011-09-26 04:53:23
【问题描述】:
我在 Windows 中找到了我的问题的解决方案,但我使用的是 Ubuntu:How to copy a directory structure but only include certain files using Windows batch files?
正如标题所说,如何递归复制目录结构但只包含一些文件?例如,给定以下目录结构:
folder1
folder2
folder3
data.zip
info.txt
abc.xyz
folder4
folder5
data.zip
somefile.exe
someotherfile.dll
data.zip 和 info.txt 文件可以出现在目录结构中的任何位置。如何复制完整的目录结构,但只包含名为 data.zip 和 info.txt 的文件(应忽略所有其他文件)?
生成的目录结构应如下所示:
copy_of_folder1
folder2
folder3
data.zip
info.txt
folder4
folder5
data.zip
你能告诉我一个 Ubuntu 的解决方案吗?
【问题讨论】:
-
我不完全确定为什么不应该将其作为 Bash: copy named files recursively preserving folder structure(2009 年表格)的副本关闭,除非目前有一个赏金在此运行。