Read and manage mail under Terminal

When opening Terminal window under Mac OS Lion, I have a message saying I've got mail . It seems to be somewhere close to ~/Library/Server/Mail/Data/spool/ but I ignore what command to be typed in order to read it and suppress it later once read.

You can use the mail command to read the mail, and while in it use the d option to delete the mail. The mail file is in /var/mail/$LOGNAME, so alternatively you can trash it all by adding this to your .profile:

> /var/mail/$LOGNAME

The only way I could suppress the message completely when opening Terminal, was to run touch ~/.hushlogin once, but that suppresses every login / profile message (including, for example, the MOTD).

In your profile, you can add unset MAILCHECK to prevent any new mail messages appearing while you are using Terminal.

HTH