Why does this invocation of find:

find . -wholename "./path/somewhere/*.py"

Take a lot longer than

find ./path/somewhere -wholename "*.py"

Is it because the first invocation will traverse the entire tree, and for each entry (regardless of where it is in the directory tree), it will do a patternmatch with wholename, whereas the second alternative traverses only the subtree matching the first parameter to find?

link|improve this question

57% accept rate
you answered it. – Prince John Wesley Jul 8 '11 at 1:01
feedback

1 Answer

up vote 1 down vote accepted

Yes, you hit the nail on the head. This is why using -prune where possible can make a find command much faster.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.