I'm working on a script to find files older than 30 days in a given folder. Based on requirement i have to delete only files with extension .log or .out and skip sub directories.
The below command is returning all the .log* files that are modified 30 days ago. However it is returning all the .out files even the recent ones. is there something wrong in the below code?
find -maxdepth 1 -mtime +30 -type f -name "*.log*" -o -name "*.out*"
could you let me know what is wrong in the above statement