Find Command Syntax

Drew Tomlinson drew at
Wed Sep 22 08:26:11 PDT 2004

I'm trying to write a script to feed the mail in my spam folder to 
Spamassassin's sa-learn and then delete the mails older than 1 day in 
that spam folder.  Here's my current directory listing:

blacklamb> ll /path/to/Maildir/.Spam/cur
total 70
-rw-------  1 user  group   6118 Sep 22 02:08,
-rw-------  1 user  group   3545 Sep 22 02:21,
-rw-------  1 user  group   7408 Sep 22 03:18,
-rw-------  1 user  group   6560 Sep 22 03:44,
-rw-------  1 user  group   5203 Sep 22 04:57,
-rw-------  1 user  group   3313 Sep 22 05:21,
-rw-------  1 user  group   5718 Sep 22 06:34,
-rw-------  1 user  group   5254 Sep 22 07:22,
-rw-r--r--  1 user  group  23314 Sep 21 18:41,S=23314:2,S

I'm trying to use the find command to do the deleting but am having 
trouble with the syntax.  For testing, I'm using this command:

blacklamb> find /path/to/Maildir/.Spam/cur \! -newerct 1d -print

It finds nothing.  I read in the manual that time specifications don't 
have much meaning without the '-' or '+' operator so I try adding it:

blacklamb> find /usr/home/tomlinson_dr/Maildir/.Spam/cur \! -newerct -1d 
find: Can't parse date/time: -1d
blacklamb> find /usr/home/tomlinson_dr/Maildir/.Spam/cur \! -newerct +1d 
find: Can't parse date/time: +1d

I've also tried a combination of adding ()'s around the expression but 
that hasn't worked either.  What am I missing?  Is this an appropriate 
choice for what I want to do?  Is there another command better suited 
for this task?



Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2801 bytes
Desc: S/MIME Cryptographic Signature
Url :

More information about the freebsd-questions mailing list