Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 645

Comment by Kamil Maciorowski on how to delete all files that are old then X days and ended with number/s

$
0
0
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.

Viewing all articles
Browse latest Browse all 645

Trending Articles