find /your/directory/here -mtime +90 -type f -exec rm -rf {} \;

This command will do a search in /var/log for all files that were last modified 90 or more days ago and executes a recursive forced (-rf) remove (rm).

The “{}” (curly braces) is the place holder for exec to use where it will put the name of the file, and the “\;” tells exec that’s the end of the statement. A a test replace the “rm -rf” with “ls -la” to get a list of all the files that would be removed.

But what if there is a directory you want to exclude from the search path?

find /your/directory/here -mtime +90 -type f ! -iwholename “*/Yo*” -exec rm -rf {} \;

In this case this I had a bunch of directories that were named Yo Bob, Yo Susie etc etc that needed to be skipped. That did it.