I guess you have a wrong perception how the pruning works.? -prune stops descending directories at the current point.
When it is preceded by a condition that becomes true for a directory, then that directory will be skipped.
When it is preceded by a condition that becomes true for a file, then the file and following files will not be excluded, only further directories in that directory will be skipped.
Do you mean that it is useless to try to prune some folders after applying a rule based on file rule ( -newer seems to be applied on file ) ?
--- Post updated at 17:30 ---
What i need is :
find "$SEARCH_PATH" \
keep file -newer "$FILE_REF_DEB" ! -newer "$FILE_REF_END" \
exclude any files in folder which name relative to search path is exactly \( .cache or .mozilla or .... /etc/dir1/dir2/dir3 \) \
exclude any files in folder which name contains partial folder name \( *properties* or *cache* or ..... )
*properties* like 'view_properties' or 'properties_icons'
*cache* like 'icon_cache' or 'cache_local'
I have tried so many syntax that i don't know what to do next
This find is equivalent to the find from the original post which returned 32 elements.
Hope this helps you work out was is going on. Note that -prune only comes into the find when you have conditions that remove directories (and all files below them).
Thank you for helping.
I rewrite my need.
From the original post :
I have rules that exclude folders using folder conditions, I have rules that exclude files using files conditions. That's ok.
Now during some times i have modifies files in different folders. But the folders have still the same organization. The rules on folders and files are still OK.
So keeping the general rules, I want apply the general rule between to dates specifies by a file_date_deb and a file date end.
find "$SEARCH_PATH" \ # still apply
keep file -newer "$FILE_REF_DEB" ! -newer "$FILE_REF_END" \ # fixe the date duration
then apply rules on folders \ should still apply
then apply rules on files \ should still apply.
that could not be :