Hi there!
Well, I'm writing a script to obtain certain information about files. Specifically, I want to get the information about those files which last access were in the last 24 hours, so I'm doing something like this:
find <directory_name> -atime -1 -printf '%f %a\n'
I would also like to add some extra information to this result: I would like to obtain the date and time of the last modification of these files if that is also during the last 24 hours, so that I might use '%t' anywhere. The problem is that not all files were also modified during this time. How could I implement this condition in the code? I want a result like this:
<file_name1> <last_access_time1>
<file_name2> <last_access_time2> <last_modification_time2>
<file_name3> <last_access_time3>
<file_name4> <last_access_time4>
<file_name5> <last_access_time5> <last_modification_time5>
... ... ...
where files 2 and 5 were modified within the last 24 hours. Is there a way to insert conditions to fulfill before printing the results? Or anything equivalent to get this behaviour?
Thanks in advance.
Regards.