Skip to content

Instantly share code, notes, and snippets.

@ansrivas
Last active January 15, 2018 15:52
Show Gist options
  • Select an option

  • Save ansrivas/c0f877a1bcbaf0a7b2f1fb81e7e68486 to your computer and use it in GitHub Desktop.

Select an option

Save ansrivas/c0f877a1bcbaf0a7b2f1fb81e7e68486 to your computer and use it in GitHub Desktop.
Using find to delete files older than sometime

delete files older than 7 days

find ./ -type f -mtime +7 -exec rm -f {} \;
-mtime +n means strictly greater than, -mtime -n means strictly less than

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment