Q. I've CentOS Linux acting as router for our small community based college. I see logwatch and other cron job generating emails for root account. How do I delete those emails? I don't want to disable email facility but just wanted to get rid of all root emails.
A. The easilst way is to empty root / users email message file i.e. /var/spool/mail/root or /var/spool/mail/username. Simply type the following command at shell:
> /var/spool/mail/root
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 11/1/07



{ 4 comments… read them below or add one }
Nothing happens when I type /var/spool/mail/root to purge the root user’s mail messages.
I think you meant,
#cat /dev/null > /var/spool/mail/root
– Nirmal.
Cheers, had forgotten all anout dev/null, thanks!
You just did oversee the > in front of /var/spool/mail/root
Works like a charm…
Thank boss……..it’s an important command