If I have a files with their filenames as the date they were created:
temp_30042019
temp_15042019
temp_10042021
temp_20022020
temp_21102022
temp_22102022
temp_01112022
How would I compare the files names against todays current date
$ echo `date +"%d%m%Y"`
#output:
01112022
If the file names date is older than 30 days then delete it. I would expect to end up with
temp_21102022
temp_22102022
temp_01112022
date +"%d%m%Y"
, you can just use:date +"%d%m%Y"