简体   繁体   English

查找所有子文件夹并复制其内容

[英]Find all subfolders and copy their contents

Currently I have the following code for copying all folders to a new location:目前我有以下代码用于将所有文件夹复制到新位置:

find /var/CommuniGate/Accounts/ -name 'Archive.folder' | cpio -pdm archiv_mount/

It works fine, but only copies the Archive.folder.它工作正常,但只复制 Archive.folder。 How can I also copy everything that is contained in Archive.folder?我如何还可以复制 Archive.folder 中包含的所有内容?

With find you can execute some commands, for example copy with recursion:使用 find 您可以执行一些命令,例如使用递归复制:

find /var/CommuniGate/Accounts/ -name 'Archive.folder' -exec cp -Rp {} archiv_mount/ \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM