Copying all files with a certain extension from all subfolders in a directory

I had to copy all of the files (calc scripts) from my Essbase servers’ application directories, and wanted to preserve the folder layout in the destination. I ran the following against all of my servers to achieve this:

cp --parents `find $ESSBASE_APP_DIR -name *.csc` .

I ended up with a destination folder containing all of my application directories with the database subdirectory containing just the calcs.

Good luck!

Please follow and like us:

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.