43 reputation
15
bio website twitter.com/omararroum
location
age
visits member for 1 year, 6 months
seen Dec 10 '13 at 18:20

Oct
11
comment Find files which are created a certain time after or before a particular file was created
You're right, your solution works ;) Thanks a lot
Oct
10
comment Find files which are created a certain time after or before a particular file was created
Hmmmm I see what you're saying, however in my case if I have the following files: 'testBefore.txt' with the modification time of 6pm and then 'test.txt' at 7pm and lastly 'testAfter.txt' at 8pm, your code will only bring up 'test.txt' and 'testAfter.txt', but not 'testBefore.txt'
Oct
10
comment Find files which are created a certain time after or before a particular file was created
Yes, GNU find is available for me. Currently using Debian GNU 6.0.5. Why? Is there a difference in the various finds?
Oct
9
comment Find files which are created a certain time after or before a particular file was created
@j-f-sebastian: what I'm saying is that currently your code picks up anything that is in the timeframe of being newer than the test.txt file by up to 59 minutes, as the ! -newermt ... deals with that. Your code currently only finds the files after the test.txt file, but it doesn't find the files which were created within the 1 hour tie frame before it. Do you see what I mean?
Oct
9
comment Find files which are created a certain time after or before a particular file was created
Ok, @j-f-sebastian tried the various ways out, however the one liner isn't fool proof. Doesn't seem to work all the time, especially when i break it down into separate chunks i.e. finding the files which are created one hour after test.txt. Any ideas?
Oct
9
comment Find files which are created a certain time after or before a particular file was created
Wouldn't I have to use -o as opposed to -a since I'm looking for files created 1 hour before OR 1 hour after the file creation/modification. Also is the one liner to be used in conjunction with anything else? I.e does $file have to be declared before somehow or can I just do "$(date -r test.txt) -1 hour" ?
Oct
7
comment Find files which are created a certain time after or before a particular file was created
I see your solution, but isn't there a more 'elegent' way of doing this? Apparently there is a 1 line solution for this problem...
Oct
7
comment Find files which are created a certain time after or before a particular file was created
Apparently there is a 1 line solution to this problem, not sure if that includes any perl scripting or if it's straight bash shell scripting.