I'd like to know if it's possible to find files on AIX between a date range, for example: I want to find all files that were created between 01-Aug-2013 and 31-Aug-2013.
p.s: I access the AIX server by telnet (not sure if this info is important, just to mention it).
I've searched online and I found several ways to do that, but none of them worked (the trick to create a empty file using touch to use the -newer option is not possible, once the touch command for me does not work due to user roles).
Pinned topic Find files by date range
Re: Find files by date range2013-08-21T06:04:42Z in response to GuilhermeDeMario
Can you be more specific regarding, if it is file Creation or modification time !?
If its modification time, this might help " ls -l | grep Aug "
hope it helps :)
Re: Find files by date range2013-08-21T12:06:03Z in response to vbalaji11
Many thanks for your kind help :-)
Yesterday I could make it works using this command:
find . -mtime +12 ! -mtime +16
I made a spreadsheet where I can get these numbers (12 and 16 in this example) using the formula =TODAY()-Start_date and TODAY()-End_date, so this way I can filter all the files by a date range.
Re: Find files by date range2013-08-26T06:19:21Z in response to GuilhermeDeMario
So happy to know, that the job's done.
It would be very helpfu and nice of you, if you could explain a little more about how you achieved it.
I am a newbie to spreadsheet handling in AIX, but eager to know how it worked out in this case. Kindly share links, if any.
Thanks in advance :)
Re: Find files by date range2013-08-26T12:09:19Z in response to vbalaji11
I used the spreadsheet attached in this message.
Just put the start and end date and the formula will generate the AIX command to find files between date range for you.
P.s: you can ignore the | xargs grep -lR 'STRING' if you want, I just made this because in my case, I had to find files between a date range and these files must had a string inside it.
Hope it helps :-)
AttachmentsUpdated on 2013-08-26T12:11:56Z at 2013-08-26T12:11:56Z by GuilhermeDeMario
Thanks for your time2013-08-27T12:01:26Z in response to GuilhermeDeMario
Thanks again. I am clear how the dates from the sheet is utilised in the find command later piped by ur grep.
In find command " find . -mtime +12 ! -mtime +16 ", I have assumed like " ! " helps in fetching the files that are having the (mintime - initialisation time) prior to END date. i.e. like a NOT gate. While the later -mtime 16 helps in fetching the files that are older than the (mintime - init time) START DATE.
Just correct, if I am wrong anywhere.
It really helped :)