Find but do not descend into directories containing the searched files
问题 I have several projects configured by a pom.xml or similar. I would like to use the linux file command to locate these projects e.g. by find -name pom.xml . This however takes some time because of the deep paths. I would like to use find -prune to stop searching in subdirectories when I already find the file, but prune only stops on matched directories not on matched files. Is there a way to get find to stop descending when the directory aleady contains a searched file? For clarification;