user3742929
user3742929

Reputation: 400

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. How can I also copy everything that is contained in Archive.folder?

Upvotes: 0

Views: 201

Answers (1)

Oriol
Oriol

Reputation: 26

With find you can execute some commands, for example copy with recursion:

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

Upvotes: 0

Related Questions