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!

[ad#ad-post]

Add a Comment

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