Reputation: 45
I must find and list the first 10 files in a number of directories that have not been modified in the last 10 minutes.
My initial answer was: find . -mindepth 0 -type f -not -mtime 10 -ls | head
But that was marked as wrong likely due to the use of "-not". I need to know why, and what the correct answer is. Thanks!
Upvotes: 0
Views: 245
Reputation: 246764
Here's another approach (probably requires GNU coreutils)
touch -d "10 minutes ago" refFile
find . -type f -not -newer refFile
Upvotes: 1