12

When I use the "mail" command, it prints a list of messages in my inbox in a format like this: 1 Super User Mon Jun 9 17:13 86/4716 Complete Registration With Stack Exchange However I've noticed that it does this with the oldest messages first. Is there a way to change this behaviour?

4
  • Are you wedded to mail? there are better command line clients, such as mailx, or pine. Pine specifically has better sorting options. Jun 9, 2014 at 17:01
  • Not completely. I have just spent a while getting mail set up however, so if there is a way to get this functionality in mail that would be prefered. Jun 9, 2014 at 17:03
  • I'd try pine, see if that is set up on your system. pine, mutt, anything but base mail - it's pretty clunky. Jun 9, 2014 at 17:07
  • In some organizations, adding applications is discouraged, if not forbidden. mail is present on most rpm based systems, at least until rhel 9 switches to s-nail. It's also available on Ubuntu (probably other deb based systems?). So the correct answer is the one with more votes, below.
    – Jeter-work
    Feb 24, 2022 at 16:19

3 Answers 3

2

To make this as an answer, I'd suggest to use pine.

The mail command really isn't made for interactive use. It's for bare bones, your system is completely hosed, and you're searching for some email from cron. For anything else, use something newer and designed for day to day use, such as pine or mutt.

3
  • 2
    What is you don't have either pine or mutt on your system?
    – alimack
    Nov 17, 2014 at 11:22
  • how is this the best answer and there is not even a link to install these applications.
    – Dave Ankin
    Jun 4, 2022 at 8:45
  • There is a program here which accomplishes the in-place sorting of a mbox format file by the "Date" header. stackoverflow.com/questions/368003/…
    – Dave Ankin
    Jun 4, 2022 at 9:30
25

For people still looking for an answer in the base mail application, the best solution I could find is running the h$ command inside mail to jump to the bottom of the list.

(Source)

2
  • 4
    This should be the accepted answer. Apr 23, 2020 at 17:04
  • Yes it should. And to read the last message, you can just type . at the & prompt. Some more helpful tips here: johnkerl.org/doc/…. Nov 30, 2020 at 23:18
0

There is a program here which accomplishes the in-place sorting of a mbox format file by the "Date" header.

https://stackoverflow.com/questions/368003/how-can-i-reorder-an-mbox-file-chronologically/368067#368067

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 4, 2022 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .