Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.