How to find files that were created or modified based on a particular timestamp.
Let's say timestamp be
Could you suggest a command which fetches files based on a particular a timestamp ?
You could use the following command:
find /path/to/dir -newermt "yyyy-mm-dd HH:mm:ss" -not -newermt "yyyy-mm-dd HH:mm:ss+1"
This command will list file in the folder
/path/to/dir modified between
yyyy-mm-dd HH:mm:ss and
yyyy-mm-dd HH:mm:ss + 1 second
This should do the trick, You can also adapt this command to find file modified at a certain minute, hour, day , month this is very flexible.
If you want to find file by access time, you can tune it like this:
find /path/to/dir -newerat "yyyy-mm-dd HH:mm:ss" -not -newerat "yyyy-mm-dd HH:mm:ss+1"
And if you want only the creation time:
find /path/to/dir -newerct "yyyy-mm-dd HH:mm:ss" -not -newerct "yyyy-mm-dd HH:mm:ss+1"
This command search between the two date you mention the first date being inclusive and the second exclusive; it find file modified at or after
date 1 and before
you want more information look at this blog article it's nice: Find Files Modified On Specific Date