I need a shell script which finds files which are created 1 hour before or 1 hour after a particular file (
test.txt) was created.
If I go with
find -newer, that means I'd have to create a temporary file, use
touch to change the time on that 1 hour before the creation time of the
test.txt file, and then use
-newer tempFile to find the files which are newer than the
tempFile, ultimately finding the files which are created 1 hour before the test.txt file. Then I have to go back through that process to find those an hour or more older than the file I'm interested in. That seems like a lot of extra work to go through to answer a simple question.
I also see
find -mmin, but I worry that it's an extension to POSIX
Any other suggestions?