Impara con i progetti
For the safe side, first, do a dry run and list files matching the criteria.
find /var/log -name "*.log" -type f -mtime +10
Once the list is verified, delete those files by running the following command:
find /var/log -name "*.log" -type f -mtime +10 -delete
This is for the case when you have multiple log files in one location with specific extension which is "*.log"
For the safe side, first, do a dry run and list files matching the criteria.
find /var/log -name "*.log" -type f -mtime +10
Once the list is verified, delete those files by running the following command:
find /var/log -name "*.log" -type f -mtime +10 -delete