On Thursday, June 12 at 01:02 PM, quoth Jeff Kowalczyk:
On Thu, 12 Jun 2008 10:19:48 -0500, Kyle Wheeler wrote:
If you have a *TON* of messages in those folders (i.e. several thousand), your shell may complain that there are too many arguments to the rm command. If that happens, these may be better commands to delete them:

find /home/user/Maildir/.Junk/cur -type f -delete find /home/user/Maildir/.Trash/cur -type f -delete

Thanks, I'm going to do that. And per dmeissler, I'm going to consider xargs.

<shrug> xargs is good for other things, but if all you're doing is deleting files, find can do it itself without involving other applications. But whatever makes you comfortable.

Any thoughts on a variant using find -name that could safely iterate over /home/*/Maildir for all users? Otherwise I would script it in python.

find /home/ -path '*/Maildir/.Junk/cur/*' -type f -delete

~Kyle
--
Nothing makes a woman more beautiful than the belief she is beautiful.
                                                       -- Sophia Loren

Attachment: pgp8W7G26oYVZ.pgp
Description: PGP signature

Reply via email to