Here is the command to find all files between two given dates with find linux command:
find /home/ -newermt 20140901T0000 -not -newermt 20141001T0000 -type f
to use “find” with
you must have find version above 4.3.3.
With older version of the find utility it can be used with the time of two files.
- create two temporary files
- “touch” them with the right time
- execute find command with “-newer”
- delete the two temporary files
Here is the bash code:
dt1=$(date -d '2014-09-01' +'%Y%m%d%H%M.%S'); dt2=$(date -d '2014-10-01' +'%Y%m%d%H%M.%S'); touch -t $dt1 "$dt1"; touch -t $dt2 "$dt2"; find . -type f -newer "$dt2" -not -newer "$dt1";rm "$dt1" "$dt2"