This one liner command - deletes files in a directory tree that are less than 5 days old, and asks if it is okay to delete each file:
Code Snippet #1:
find /path/to/directory -mtime -5 -ok rm -f {} \;
Explanation:
- mtime- modification time older than 5days in this case
- -f – files to be deleted