How to delete all root email in inbox from shell prompt

Many Linux /Unix based systems are pre-configured to send email notifications about various system events to root user.The emails generated are for multiple reasons, it may be for some cron job completion or cron job failure or ntofications about systems resource usages.By default, the recipient of all those messages is root@localhost.If you want to check the emails simply type mail at the command prompt.You will get all the system generated emails received for that user.

    [root@localhost ~]#mailIf you want to remove /empty  root / users email message file then type[root@localhost ~]#>/var/spool/mail/root

the above command removes all the email for user root.The same process can be applied for any other user account.

Leave a Reply