Given a directory structure like
parent
- child1
- file1
- file2
- file3
- child2
- file1
- file3
- child3
- file1
- file2
- file3
- file4
what command will delete all child directories of parent that contain all or some of file1, file2, file3 but no others. I.e. in the example child1 and child2 should be deleted but child3 should remain since it also contains file4.
Please post both a dry run and actual version of the command to first check which folders would be deleted.
You would probably need a function that deletes the child directories only if it does not contain a set of input file(s) you want to check for.
example output:
You'd be better off using python for such operations if you're are at liberty to choose, since you can make it much simpler and modular.