How can I stop find from searching after first result found?

Viewed 101

I am using 'find' to get the path to a dir called "out" and want it to stop looking after it is found. There can be some 350G worth of files in that dir so I REALLY want it to stop looking once it is found.

This works bu doesn't stop looking, takes too long..

find . -type d -name out  

This "ungreedy" approach also works but doesn't seem to stop either...

find . -type d -regex ".+/out/?"

I'm running this in perl, so I suppose I could write a recursive function that reads down a dir tree and does what I want. But is there a brake in "find" that I can apply once the first instance is found?

Thanks in Advance !

1 Answers
Related