Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
you answered it. –  Prince John Wesley Jul 8 '11 at 1:01
add comment

1 Answer

up vote 3 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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