{ 14 comments… read them below or add one }

1 Nirmal Pathak February 19, 2009

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.

Reply

2 Jorge Tarlea October 12, 2010

Thanks, it worked!

Reply

3 Adam Ziaja September 28, 2011

because you need type > before file to clear…

Reply

4 Cian March 31, 2009

Cheers, had forgotten all anout dev/null, thanks!

Reply

5 Kaspar September 10, 2009

You just did oversee the > in front of /var/spool/mail/root
Works like a charm…

Reply

6 Md. Mizanur Rahman November 4, 2009

Thank boss……..it’s an important command

Reply

7 Sunil April 21, 2010

Great thanks for the command

Reply

8 //Sessl December 10, 2010

mail
d 1-x

d = delete
1-x = mail 1 to mail x (e.g. d 1-53)

Reply

9 Khupcom December 12, 2010

Here the simple way to delete all mail
echo ‘d *’ | mail -N

Reply

10 fukid October 14, 2011

Thanks!
It works!!

Reply

11 wolvies December 12, 2011

I’ve tried that but received this message: ‘Value too large for defined data type’ :-(
can anybody help me?

thanks from now !!!

Reply

12 baanmaha April 9, 2011

Thank you for advice worked..

Reply

13 linux course July 19, 2011

gud information.worked great.
Thanks….

Reply

14 Mars January 25, 2012

Use Nirmal’s solution above:

`cat /dev/null > /var/spool/mail/root`

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 4 + 12 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: