onertipaday
4/13/2018 - 7:24 AM

Remove all files between two dates_hours - Unix command line

FInding and deleting files bwtween a fixed timeframe.

#use this to check the files are going to be deleted are the right ones
find . -maxdepth 1 -type f -newermt '2016-10-12 14:22:59' ! -newermt '2016-10-12 14:24:59'
# delete them
find . -maxdepth 1 -type f -newermt '2016-10-12 14:22:59' ! -newermt '2016-10-12 14:24:59' -deleted