How do I delete everything in /var/mail/username from the command line?

If you want to delete all the messages, you can simply truncate the mailbox file for a user with the following command:

> /var/mail/username

(the greater than sign is not a prompt: you are in effect redirecting the output of nothing to the file, which will truncate it).


Run mail in a terminal. Press d 1-. This will delete those messages.

Removing files for managing mail is like adjust the volume of your tv with a hammer. It may work, but it is not optimal and far too brutal.

Tags:

Mail