Gavin suggested a clever trick to recursively get the list of all the files in in a directory, except those under .svn. It goes like this:find WEB-INF -path "*/.svn" -prune -o -print
I used this quite a bit, but never thought about how this really works, until today:
- The
-ois an or operator. So either-path "*/.svn" -pruneor-printis true. Let's look at each part. - The first part
-path "*/.svn"is true for the.svndirectories and with-prunewe skip the content of those directories. - If you just had the first part, you would be skipping over the content of the
.svndirectories, but not over the directory itself. The second part-printprints what isn't matched by the first part (because of the or). So it won't print the.svndirectories.
- directories;
- files in the CVS directories.
find . -path "*/CVS" -prune -o -type f -exec rm {} \;This can be useful for instance when you have files checked out from CVS or Subversion and want to replace all your files by a copy of those files that you receive from someone in an archive.



