我經(jīng)常用root帳號登錄RHEL5,在終端經(jīng)常出現(xiàn):
You have new mail in /var/spool/mail/root
這肯定是系統(tǒng)給root超級管理員發(fā)的一些通知郵件,我常用mail命令來查看。
【注意】下面mail命令的help幫助是我個人隨便翻譯的,準(zhǔn)確的請看英文說明
[root@pps mail]# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 24 messages 24 unread
>U 1 logwatch@rhel5-pps.h
Mon Feb 16 17:27 117/3862 "Logwatch for rhel5-pp"
U 2 logwatch@rhel5-pps.h
Mon Feb 16 17:27 107/3658 "Logwatch for rhel5-pp"
...
U 20 logwatch@pps.hoho.co
Wed Mar 11 10:10 139/4567 "Logwatch for pps.hoho"
U 21 root@pps.hoho.com
Wed Mar 11 13:15 20/664 "Re: Warning: could no"
U 22 MAILER-DAEMON@pps.ho
Wed Mar 11 13:15 71/2294 "Returned mail: see tr"
& help //如果不會使用或者忘記了什么命令,就輸入 help 或者 ? 來獲取幫助
Mail Commands
t 打印出信息 【注意】多個信息用空格分開,如 t 1 7
n 打印出下一條信息
e 編輯信息
f 輸出信息的頭行
d 刪除信息
s file 追加信息到文件file
u 不刪除某信息
R 回復(fù)發(fā)件人
r 回復(fù)發(fā)件人和本信息所有的收件人
pre 保留信息在 /usr/spool/mail 1*
m 發(fā)郵件,多個收件人用空格分開【需要sendmail支持】
q quit, saving unresolved messages in mbox 2*
x quit, do not remove system mailbox
h print out active message headers
! 讓shell執(zhí)行某命令,如 !ls 輸出ls命令結(jié)果
cd [directory] 改變目錄,這里不用 !cd,但打印當(dāng)前目錄需要 !pwd
A consists of integers, ranges of same, or user names separated
by spaces. If omitted, Mail uses the last message typed.
A consists of user names or aliases separated by spaces.
Aliases are defined in .mailrc in your home directory.