41

Using the mail command it shows the messages I have and drops me into a prompt, but I cannot figure how to list the messages. Here is the help screen for mail:

Mail Command                    Description
-------------------------       ---------------------------------------------
t [message list]                type messages(s).
more [message list]             read message(s), through the $PAGER
n                               goto and type next message.
e [message list]                edit message(s)
f [message list]                give head lines of messages.
d [message list]                delete message(s).
s [message list] <file>         append message(s) to file.
u [message list]                undelete message(s).
R [message list]                reply to message sender(s).
r [message list]                reply to message sender(s) and all recipients.
p [message list]                print message list.
pre [message list]              make messages go back to /var/mail.
m <recipient list>              mail to specific recipient(s).
q                               quit, saving unresolved messages in mbox.
x                               quit, do not remove system mailbox.
h                               print out active message headers.
!                               shell escape.
| [msglist] command             pipe message(s) to shell command.
pi [msglist] command            pipe message(s) to shell command.
cd [directory]                  chdir to directory or home if none given
fi <file>                       switch to file (%=system inbox, %user=user's

As you can see, none of these commands list the messages in the mailbox.

1 Answer 1

59

h

Although the help text may not be particularly clear, h is the command to list messages. Placing a valid message number after h will list a range of messages containing the given one. For instance, if you have 50 messages and type h30, it may list messages 21 through 40.

f

For displaying only particular messages, you can use f with various qualifiers. So, f* displays everything, while f 1-10 20-24 displays the messages 1 through 10 and 20 through 24.

2
  • +1, h1,h100,h200 so on Nov 10, 2016 at 4:35
  • works on my version. Nov 10, 2016 at 13:45

You must log in to answer this question.

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