How to Selecting all emails except for specific ones?

MoviHussein

Member
Jun 23, 2022
6
1
3
ns555389.ip-54-39-16.net
cPanel Access Level
Root Administrator
I have a code which selects all emails that start with "scan" and delete the sent emails in the folder that are a day or more older as seen below

find /home/admin/mail/mov.com/scan*/.Sent -type f -mtime +1 -exec rm {} \;

I want to be able to now the Select all emails in my domain except for the ones that start with "scan" but I do not know how to add the exception code or work it out where it can select other emails except for those ones.

Any help would be appreciated.

Thank you.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,845
1,882
363
cPanel Access Level
Root Administrator
Hey there! This is more a question about regex on Linux than cPanel, but there are operators for find that will handle this. You can find more details on that here: