Follow-up Comment #4, bug #54730 (project findutils): I agree. I'm trying to find a good example.
What about the following? --------------------------------------------------------------------------- Find the name of a file in the current directory (and below) which contains the word "needle", and stop when the first such file is found. # Prepare 4 files, 2 of them contain the word "needle". $ touch a b c d $ echo needle > b $ echo needle > dc Without -quit, 'find' would call 'grep' for every file (and there's currently no option to make 'grep' stop after a match across files): $ find -type f \ -printf 'Checking: %p ...\n' \ -exec grep -FH needle '{}' \; Checking: ./c ... ./c:needle Checking: ./d ... Checking: ./a ... Checking: ./b ... ./b:needle With -quit, 'find' stops after the first match: $ find -type f \ -printf 'Checking: %p ...\n' \ -exec grep -FH needle '{}' \; \ -quit Checking: ./c ... ./c:needle -------------------------------------------------------------------------- _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?54730> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/