Let's say I have a directory containing several subdirectories, each of which contains several files. I want to check which of these directories do not contain a specific file. For example, if these are my directories:
dir/A:
foo
bar
dir/B:
bar
dir/C:
foo
dir/D:
dir/E:
foo
bar
If I wanted to list all directories not containing foo, I would get:
dir/B
dir/D
Can this be done using unix find, or do I need to use some alternative tool?
source
share