Make 2 files that will be the marking point of the beginning and the end.

touch -t yyyymmddHHMMSS start_date_file_name
touch -t yyyymmddHHMMSS end_date_file_name

Then delete everything between those 2 days:

find . -type f -newer start_date_file_name ! -newer end_date_file_name -exec rm -f {} \;

In english that command means:
Find all files in this folder (and recursively down) that are newer than start_date_file_name and not newer than end_date_file_name, then run rm -f on each of those files.

To see what is being deleted:

find . -type f -newer start_date_file_name ! -newer end_date_file_name -exec rm -vf {} \;

Delete every file newer than 1990/01/01 and older than 2013/01/01 in this folder (not recusively down)

touch -t 19900101000000 start_date_file_name
touch -t 20130101000000 end_date_file_name
find . -type f -maxdepth 1 -newer _START ! -newer _END -exec rm -vf {} \;

Another Article:
Find & Delete files older and newer than X days. (not by date, but age). Another article on same topic: Deleting files by age

Leave a Reply

Your email address will not be published. Required fields are marked *