What is the explanation? If
-regex '^.*[0-9]$'
works, shouldn't -name '*[0-9]'
have worked in the first place? Don't get me wrong, your code looks fine by itself; but the answer makes an impression that -name
is wrong for the job and -regex
is right. Why? The OP's code didn't work probably because the files in question were modified on August 7, the question was posted on August 8, so -mtime +6
did not match the files at that time. OTOH your answer was accepted on August 9. There is something fishy here.