I set up a cronjob a long time ago that now doesn't exist. Whenever I open up Terminal, it now says "You have mail". I have something like 100 messages that all say the same thing. How do I mass delete all of the messages?
Launch the UNIX
You'll see a list of all your messages. From the mail prompt, do
? delete * ? q
And that should be it. Make sure do to the
q after the
delete * command, that saves the changes to disk.
You may also go the direct route and just run
: > /var/mail/$USER to empty the mail file.
PS: Deleting the mail file requires sudo, just setting it to empty is enough.