Delete a range of email messages using the ‘mail’ command

emailmail-commandsolaris

I have about 1k+ mails in an inbox (old cronjob stdout). How do I delete them in bulk?

I'm on Solaris 8 and I have only mail available, no pine or mutt or similar "UI"-based client.

Inline help and man page only give d # to delete a specific mail. I've tried for example d 1 - 100 but no luck. And I don't feel like doing d 1000 times.

Any ideas how to clean up this inbox? I'd actually like to purge all mails older than x days.

Best Answer

While mail may not be able to, and you don't have pine or mutt you probably do have mailx. And mailx can d 5-10 or d *.

Related Question