bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The quickest way to not to descend into sub-directories once a file is f


From: Peng Yu
Subject: The quickest way to not to descend into sub-directories once a file is found?
Date: Thu, 26 Sep 2019 21:57:09 -0500

Hi,

I'd like to find files named `file.txt` recursively. But the directory
structure has a property that if any directory has a file `file.txt`,
any of its subdirectories will not have file.txt anymore.

Therefore, the quickest way to `find` is to stop descending into
subdirectories if their ancestor directories already have `file.txt`.

But I don't see how to encode this rule with `find` (-prune doesn't
seem to apply to this case).

Is there a way to do so with `find`? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]