To delete files older than 5 days from a directory, we can use command.
find /directory -type f -mtime +5 -delete
But, in my case, I want to delete only those files having 'YYYY-MM-DD' in their names and which are older than 5 days.
Below are some example of filenames:
Only files having name in format 'YYYY-MM-DD' and older than 5 days should get deleted.
How to match filenames in find command using regex ??