/var/mail is very large – Linux

Use putty to log into your Linux server. You will probably need the root password.
After you login if you need root access type su and enter the password

Type the word mail and press Enter.

You’ll see a list of messages (or maybe just one message).

Enter the number of the message that you want to read, e.g. press 1 and Enter.

Press ‘d’ to delete the message.
You can also use d* to delete all messages
or d1-100(ex d1-1000 to delete 1000 messages) to delete a specific range

Repeat steps 3-4 until you’ve deleted all the messages.

Type quit and press Enter.

Also if you want you can make a blank file
Copy your original file then make it blank
At first
cp /var/mail/root /var/mail/root.backup
cat /dev/null > /var/mail/root

You can change root to whichever username you are recreating

Mark as helpful. 0

Posted in: Linux, Server