Tiny Core Linux

General TC => General TC Talk => Topic started by: bigpcman on May 25, 2009, 07:33:02 PM

Title: Find command advice for finding all files of a specific date and time range
Post by: bigpcman on May 25, 2009, 07:33:02 PM
Does anyone know how to modify this command to cover a range in the seconds field. Let's say over a 5 second range. A better command would of course be appreciated.

Code: [Select]
sudo find . -type f -print0 | xargs -0 sh -c 'for i in "$@"; do if stat "$i" | grep -q "^Modify: 2009-05-25 16:39:43.000000000"; then echo "$i"; fi; done'
Note I want to be able to enter any date and time as the starting point (not a relative date as in mtime).
Title: Re: Find command advice for finding all files of a specific date and time range
Post by: roberts on May 25, 2009, 11:43:37 PM
Let me see, if I understand. You want to enter any date and time and find all files over the complete filesystem within 5 seconds based on the Modify attribute?
Title: Re: Find command advice for finding all files of a specific date and time range
Post by: bigpcman on May 26, 2009, 12:06:00 AM
Let me see, if I understand. You want to enter any date and time and find all files over the complete filesystem within 5 seconds based on the Modify attribute?

Yes, within a 5 second range.

edit: I use -prune in the find command to narrow the search to avoid the tmp/tcloop area.