find mtime rm code example
Example 1: delete old files linux
find /opt/backup -type f -mtime +30 -exec rm -f {} \;
Example 2: find mtime rm
find /path/to/files* -mtime +5 -exec rm {} \;
find /opt/backup -type f -mtime +30 -exec rm -f {} \;
find /path/to/files* -mtime +5 -exec rm {} \;