27 comment

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

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

  3. 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).

Leave a Comment