I had a Shell script that removes the files that are in a directory older than the specified days.
find /test/files -mtime +10
I would like to add another condition to the find command above that is to exclude any file starting with �CGU'
Thanks
Untested and without knowing what Operating System (and therefore what version of "find") you have:
find /test/files \( -mtime +10 -a ! -name CGU\* \) -print
The escaped brackets \( and \) protect them from Shell and pass them to "find" for evaluation. The "-a" means "and" to "find". The "!" means "not" to "find". Thus we have built a boolean condition to match the requirement.