find a folder not containing a specific file
I need to find, using the 'find' command, a file not containing a specific file.
It is easy to find folders containing the file, using
find "x/x/x/x/" -maxdepth N -mindepth N -type f -iname '*filename.ext'
The min- and max-depth params are there because this file will always appear at a certain level in the (rather deep) folder hierarchy (the bottom, actually).
How would I identify folders at this depth that do not contain this file? I cannot just negate the 'name' parameter, because there are other files having arbitrary names that reside within the same folders as 'filename.ext' that would match the pattern.
Thanks!
|