i run this command
find BAR -type f -mtime +1095 # older than 3 years
and find this file:
BAR/foo.pdf
So i run this:
stat BAR/foo.pdf
Access: 2020-01-03 01:32:05.584393000 -0500
Modification: 2017-12-04 07: 59: 36.963225900 -0500
Change: 2020-01-02 10: 26: 28.907127100 -0500
# or
find BAR/foo.pdf -type f -printf "%p\n%a\n%c\n\n"
Fri Jan 3 01:32:05.5843930000 2020
Thu Jan 2 10:26:28.9071271000 2020
'Access' and 'Change' date is less than 3 years old
and if a run
find BAR -type f -ctime +1095 # older than 3 years
get nothing
What I want is to delete any files that have not been used (access or change or modify) in 3 years
PD: in the example, only 2 criteria are met. I would like my command to search for files that meet the 3 criteria: That has not been accessed, modified or changed for more than 3 years
-ctimeand-mtimewithin onefindcommand? Or how to makefindactually delete files? – Kamil Maciorowski Nov 02 '21 at 14:50-type fand-ctime +1095, you would usefind BAR -type f -ctime +1095. And you did. So you're already using two tests that must match simultaneously. What keeps you from adding more tests this way? – Kamil Maciorowski Nov 02 '21 at 14:56find BAR -type f -ctime +1095 -mtime +1095 -atime +1095– acgbox Nov 02 '21 at 14:58find BAR -type f -ctime +1095gives you nothing then adding more tests that must match will also give you nothing. InBARthere are no files that match the criteria. But in general this is how you add tests that must all match. In another directory there may be files that pass the tests. – Kamil Maciorowski Nov 02 '21 at 15:01