I am (ab?)using the unix 'find' command to recursively export files from a directory tree that is littered with .svn directories. This command takes a long time to run. Is there a faster way to accomplish the same thing?
find source/ -type f -and ! -path '*.svn*' -and -exec cp {} export \;
What I want to do is search every subdirectory in the directory tree starting at source/
, and copy any files in those directories to the export
directory, skipping any files that are in the .svn directories
Update: (complete solution, based on the answer posted by Michał Šrajer):
find source/ -type f -and ! -path '*.svn*' -and -print0 | xargs -0 \
cp --target-directory=export
For those who are curious: xargs on Wikipedia.