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?
Asked
Active
Viewed 1.2k times
11
qqqqqqqqyyuuuuuuu
- 113
- 1
- 1
- 4
-
Are you wedded to `mail`? there are better command line clients, such as `mailx`, or `pine`. Pine specifically has better sorting options. – Rich Homolka Jun 09 '14 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. – qqqqqqqqyyuuuuuuu Jun 09 '14 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. – Rich Homolka Jun 09 '14 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 '22 at 16:19
3 Answers
23
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)
Stephen Rauch
- 3,091
- 10
- 23
- 26
bhygate
- 331
- 2
- 2
-
2
-
Yes it should. And to read the last message, you can just type `.` at the `&` prompt. Some more helpful tips here: https://www.johnkerl.org/doc/mail-how-to.html#:~:text=To%20view%20a%20message%2C%20just,to%20n%20(or%20%2B). – TheProletariat Nov 30 '20 at 23:18
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.
Rich Homolka
- 31,057
- 6
- 55
- 80
-
2
-
how is this the best answer and there is not even a link to install these applications. – Dave Ankin Jun 04 '22 at 08:45
-
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 – Dave Ankin Jun 04 '22 at 09:30
0
There is a program here which accomplishes the in-place sorting of a mbox format file by the "Date" header.
Dave Ankin
- 101
- 2
-
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](/help/how-to-answer). – Community Jun 04 '22 at 09:47