Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I Get a list of all files modified , say 3 months ago. I checked this question but I was not able to apply it to my scenario. I am trying this now , it seems to be working , but I know there should be a better way using find.

ls -ltR | grep -v '2011-05' | grep -v '2011-06' | grep -v '2011-07' | grep -v '2011-08
share|improve this question

2 Answers 2

up vote 11 down vote accepted

One solution is: find -type f -mtime 90

That finds files that was last modified exactly 90 days ago.

find -type f -mtime -90 finds files that were modified in last 90 days.

share|improve this answer

As @hknik says, the -mtime operation on find is likely your best bet, but if you want to get all files around three months ago, then you need a bigger net:

find . -type f -mtime -105 -mtime +77

This will find the regular files in the month surrounding three months ago, between 11 and 15 weeks ago.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.