hereHere is a long bash line, maybe a bit obscure but workingsolution.
f30days=$(date +%s --date="-30 days");
for file in 20*.txt; do
fdate=$(echo $file | tr _ -);
fsec=$(date +%s --date=${fdate/.txt/});
if [[ $fsec -lt $f30days ]]; then
echo "rm $file";$file"
fi ; fi
done
I ended it with "echo rm $file""echo rm $file" instead of really deleting your files, this will test the result before...