Skip to content

Instantly share code, notes, and snippets.

@hadl
Last active January 12, 2018 09:08
Show Gist options
  • Save hadl/8330988 to your computer and use it in GitHub Desktop.
Save hadl/8330988 to your computer and use it in GitHub Desktop.
Delete PNGs older than 30 days
# more info: http://www.vionblog.com/linux-delete-files-older-than-x-days/
find . -type f -name '*.png' -mtime +30 -exec rm {} \;
# better use delete flag :)
find . -type f -name '*.png' -mtime +30 -delete;
# use -mmin instead of -mtime for minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment