Start the discussion at

Historical Comment Archive

27 comment

  1. 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.

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

      thanks from now !!!

  2. I have deleted the file “root” from /var/spool/mail itself and from then on nobody is receiving the emails upon our transactions.

    Please suggest me a solution if any?

  3. You can’t cat /dev/null; it is a block special device. It also outputs nothing and closes right away; it is the same as the original post in concept. the Null device is a place to output stuff you don’t want, its opposite would be ‘/dev/zero’. The original one doesn’t work because it is unbalanced- there is nothing going into the file.

    ‘exit > /path/to/file’

    Is basically what the cat /dev/null does. You want

    echo > /path/to/file. instead.

  4. Fantastic! – Just cleared 35000 unread mail items ;-)

    Keep up the good work, stay safe!
    Paul :-)

  5. what will be the impact if I use the command for oracle file which is more than 3 gb .If there is no bad impact ,can i execute on Production server,can I get any script

    cat /dev/null > var/spool/mail/oracle

    1. This will delete the mail messages for user ‘oracle’, leaving the file intact as a zero-byte file. If you don’t need the messages, this is safe to do. HOWEVER, you should get into the habit of saving this file off somewhere before you issue this command (ftp the file to your local machine, then put it on a disk or something…just in case you need to refer to it later).

    Still, have a question? Get help on our forum!