Skip to content

Instantly share code, notes, and snippets.

@onertipaday
Created April 13, 2018 07:24
Show Gist options
  • Save onertipaday/68d7a7c0da3c7c75f47046a4a091c83f to your computer and use it in GitHub Desktop.
Save onertipaday/68d7a7c0da3c7c75f47046a4a091c83f to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment