Commands to delete files older than X days
Delete files older than X days
To delete files older than X days, please execute the below commands. The below commands will remove files from a specific folder location in your machine\server. If you want to change the day, then just change value of 90 with your value,
find /directory/path/to/your/file -mindepth 1 -mtime +90 -delete
or
find /directory/path/to/your/file -type f -mtime +90 -exec rm {} \;
or
find /directory/path/to/your/file -mindepth 1 -type f -mtime +90 | xargs rm
Before executing the script,
After executing the script