How to find file accessed/created just few minutes ago How to find file accessed/created just few minutes ago shell shell

How to find file accessed/created just few minutes ago


Simply specify whether you want the time to be greater, smaller, or equal to the time you want, using, respectively:

find . -cmin +<time>find . -cmin -<time>find . -cmin  <time>

In your case, for example, the files with last edition in a maximum of 5 minutes, are given by:

find . -cmin -5


If you have GNU find you can also say

find . -newermt '1 minute ago'

The t options makes the reference "file" for newer become a reference date string of the sort that you could pass to GNU date -d, which understands complex date specifications like the one given above.


To find files accessed 1, 2, or 3 minutes ago use -3

find . -cmin -3