Skip to content

Instantly share code, notes, and snippets.

@mrmoje
Created February 21, 2017 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmoje/9573f0dd3112883ead65968aedc2c14e to your computer and use it in GitHub Desktop.
Save mrmoje/9573f0dd3112883ead65968aedc2c14e to your computer and use it in GitHub Desktop.
nuke directories by date threshold
#credit:- http://stackoverflow.com/questions/33091013/delete-files-older-than-specific-date-in-linux
#example:- nuke all files created before jan 1 2017,
touch -t 201701010000 /tmp/2017-Jan-01-0000
find `pwd` -maxdepth 1 -type d ! -newer /tmp/2017-Jan-01-0000 -exec rm -rf "{}" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment