13

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.

21

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.

  • +1, h1,h100,h200 so on – mikejonesey Nov 10 '16 at 4:35
  • works on my version. – mikejonesey Nov 10 '16 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.