How to view the last mail in linux

Source: Internet
Author: User

How to view the last mail in linux

The mail instruction is too bad on the Internet. I will not repeat it again. Here I will only talk about my situation and skills.

Recently, due to linux time synchronization and crontab settings, a mail is generated every time you run the command, which contains time difference records after time synchronization, during each inspection, you need to check the time difference of the last time, but haven't cleaned up the mail files for a long time. Therefore, it takes too much trouble to find tens of thousands of mails one by one, if you can directly read the last mail, it would be better. It must be the latest mail.

It is inconvenient to directly use the z or Z command to view the subsequent emails, and it is difficult to judge the date format. Therefore, I thought of a simple method to view the latest email directly.

Run the file command to check the total number of emails.


You can use the file command to notify you of a total of 1640 emails. Normally, the last one should be the latest generated email.

Enter 1640 directly to access this mail to see if it is the latest email we need.


We can see that the email is sent at on the 31st day, which exactly matches our current date and time.

So far, let's check the fulfillment of the latest email.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.