dublintech
dublintech

Reputation: 17785

Finding files that changed within a certain time period

I have a windows 7 box with a cygwin installed. For a given folder, how do I find what files' timestamp is in a certain range? I need the check to be recursive for all folders.

Upvotes: 2

Views: 337

Answers (1)

Jimmy Pitts
Jimmy Pitts

Reputation: 2382

You can use find to search for a time range, but it is a bit of a workaround.

Create two temp files, for example temp1, temp2

touch --date 'yyyy-mm-dd' temp1
touch --date 'yyyy-mm-dd' temp2

This will change the timestamps for these files to whatever you set them. Then use find with these files as the range:

find /some/dir/ -newer temp1 -not -newer temp2

Note, your search will return dates newer than, but not including temp1, and dates older than, including temp2.

Upvotes: 1

Related Questions