linux mail命令查看邮件/mail控制台
生活随笔
收集整理的這篇文章主要介紹了
linux mail命令查看邮件/mail控制台
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
- 前言
- 收到郵件了
- tail 命令查看郵件
- mail命令查看郵件
- 進入mail控制臺
- 幫助
- 郵件列表分頁顯示
- 郵件列表最后一頁
- 閱讀當前郵件
- 翻頁
- 移動指針
前言
- CentOS Linux release 7.6.1810 (Core)
收到郵件了
在控制臺會看到這樣一個提示You have new mail in /var/spool/mail/root,比如:
shell> ll total 0 You have new mail in /var/spool/mail/root此時,表示你收到郵件了。
tail 命令查看郵件
shell> tail -30 /var/spool/mail/root From root@xxx.localdomain Tue Mar 8 11:40:02 2022 Return-Path: <root@xxx.localdomain> X-Original-To: root Delivered-To: root@xxx.localdomain Received: by xxx.localdomain (Postfix, from userid 0)id A25C2602A6; Tue, 8 Mar 2022 11:40:02 +0800 (CST) From: "(Cron Daemon)" <root@xxx.localdomain> To: root@xxx.localdomain Subject: Cron <root@xxx> /usr/service/script/autoCleanLog.sh & Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: <XDG_SESSION_ID=118626> X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0> X-Cron-Env: <LANG=en_US.utf8> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/root> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> Message-Id: <20220308034002.A25C2602A6@xxx.localdomain> Date: Tue, 8 Mar 2022 11:40:01 +0800 (CST)clean file start ...... clean file endmail命令查看郵件
進入mail控制臺
shell> mail Heirloom Mail version 12.5 7/5/10. Type ? for help. "/var/spool/mail/root": 9313 messages 11 new 9312 unread ......U9302 (Cron Daemon) Tue Mar 8 10:00 27/950 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh" >N9303 (Cron Daemon) Tue Mar 8 10:20 26/940 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh"N9304 (Cron Daemon) Tue Mar 8 10:40 30/1396 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh"...... & <mail控制臺,在此輸入mail命令>- >為指針,指向當前郵件。
- N表示新郵件
- U表示未讀郵件
- 進入mail控制臺后,顯示郵件列表最后一頁。
幫助
& helpmail commands type <message list> type messages next goto and type next message from <message list> give head lines of messages headers print out active message headers delete <message list> delete messages undelete <message list> undelete messages save <message list> folder append messages to folder and mark as saved copy <message list> folder append messages to folder without marking them write <message list> file append message texts to file, save attachments preserve <message list> keep incoming messages in mailbox even if saved Reply <message list> reply to message senders reply <message list> reply to message senders and all recipients mail addresses mail to specific recipients file folder change to another folder quit quit and apply changes to folder xit quit and discard changes made to folder ! shell escape cd <directory> chdir to directory or home if none given list list names of all available commandsA <message list> consists of integers, ranges of same, or other criteria separated by spaces. If omitted, mail uses the last message typed.郵件列表分頁顯示
h|headers 顯示當前郵件所在頁的郵件列表。
當郵件很多時,郵件列表被分頁顯示,每頁顯示75條郵件:
- 當前郵件編號為1時,顯示郵件列表的第一頁(1-75號)。
- 當前郵件編號為2時,顯示郵件列表的第一頁(1-75號)。
- …
- 當前郵件編號為75時,顯示郵件列表的第一頁(1-75號)。
- 當前郵件編號為76時,顯示郵件列表的第二頁(76-150號)。
- 當前郵件編號為77時,顯示郵件列表的第二頁(76-150號)。
- …
- 當前郵件編號為150時,顯示郵件列表的第二頁(76-150號)。
- …
郵件列表最后一頁
z 顯示郵件列表最后一頁。
閱讀當前郵件
more|p|page 閱讀當前郵件(指針所指向的郵件)的內容。 閱讀時,按回車鍵打開下一封郵件。
& more Message 9303: From root@hdcommunity-01.localdomain Tue Mar 8 10:40:02 2022 Return-Path: <root@xxx.localdomain> X-Original-To: root Delivered-To: root@xxx.localdomain Received: by xxx.localdomain (Postfix, from userid 0)id A25C2602A6; Tue, 8 Mar 2022 11:40:02 +0800 (CST) From: "(Cron Daemon)" <root@xxx.localdomain> To: root@xxx.localdomain Subject: Cron <root@xxx> /usr/service/script/autoCleanLog.sh & Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: <XDG_SESSION_ID=118626> X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0> X-Cron-Env: <LANG=en_US.utf8> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/root> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> Message-Id: <20220308034002.A25C2602A6@xxx.localdomain> Date: Tue, 8 Mar 2022 11:40:01 +0800 (CST)clean file start ...... clean file end翻頁
閱讀時,按回車鍵打開下一封郵件。
移動指針
f num |from num 指針移動到某一封郵件。
& h ......U9302 (Cron Daemon) Tue Mar 8 10:00 27/950 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh" >N9303 (Cron Daemon) Tue Mar 8 10:20 26/940 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh"N9304 (Cron Daemon) Tue Mar 8 10:40 30/1396 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh"...... & f 9304N9304 (Cron Daemon) Tue Mar 8 10:40 30/1396 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh" & h ......U9302 (Cron Daemon) Tue Mar 8 10:00 27/950 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh"N9303 (Cron Daemon) Tue Mar 8 10:20 26/940 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh" >N9304 (Cron Daemon) Tue Mar 8 10:40 30/1396 "Cron <root@xxx> /usr/service/script/autoCleanLog.sh" ......總結
以上是生活随笔為你收集整理的linux mail命令查看邮件/mail控制台的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 美瞳左右怎么分
- 下一篇: 【若依(ruoyi)】部门查询SQL