DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Search For Files Modified The Last ... Days

05.17.2006
| 47087 views |
  • submit to reddit
        Searches for files modified up to 4 days ago. Change the 4 to whatever you desire.

find ./ -type f -mtime -4 -exec ls -al {} \;
    

Comments

Snippets Manager replied on Thu, 2006/06/08 - 11:19am

Searches for files modified between certain dates. Here for files older than 30 days but younger than 60 (penultimate month). find ./ -type f -mtime -60 ! -mtime -30 -exec ls -la {} \;