I'd like to find all directories that contain both a Makefile and a file matching *.tex. The command find or locate easily finds one or the other. But how can those results be merged or intersected, to yield just the directories desired?
A useful answer generalizes to other filenames. Even better, it can merge more than two such queries.
(I don't see how to apply find's boolean operators, e.g. "and" expr1 -a expr2. Ditto for locate -A. Maybe two searches, strip the filenames and keep the paths, sort -u, into comm -12 <(cmd1) <(cmd2)?)