Skip to content

Instantly share code, notes, and snippets.

@itspacchu
Last active March 7, 2025 06:41
Show Gist options
  • Save itspacchu/e473dc08ecc8809f52986973d0742407 to your computer and use it in GitHub Desktop.
Save itspacchu/e473dc08ecc8809f52986973d0742407 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Deleting files older than 5 days"
files=$(find ./ -mtime +5)
for file in $files; do
echo "- Deleted $file"
rm -rf $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment