The following gives you a summary of the mail command and subcommands available for your use:
The following information summarizes the system commands to execute
mail:
Displays the system mailbox. | |
mail -f | Displays your personal mailbox (mbox). |
mail -f +folder | Displays a mail folder. |
mail user@address | Addresses a message to the specified user. |
When the mail program is processing a mailbox, it displays the mailbox prompt to indicate that it is waiting for input. The mailbox prompt is an ampersand (&) displayed at the beginning of a new line. At the prompt, you can enter any of the mailbox subcommands.
q | Quits and applies the mailbox subcommands entered this session. |
x | Quits and restores the mailbox to original state. |
! | Starts a shell, runs a command, and returns to the mailbox. |
cd dir | Changes directory to dir or $HOME. |
t | Displays the messages in msg_list or the current message. |
n | Displays the next message. |
f msg_list | Displays the headings of messages in msg_list or of the current message if msg_list is not provided. |
h num | Displays the headings of groups containing message num. |
top num | Displays a partial message. |
set | Displays a list of all enabled .mailrc options. |
ignore | Displays a list of all the ignored header fields. |
folder | Displays the number of messages in the current folder along with the path name of the folder. |
e num | Edits the message num (default editor is e). |
d msg_list | Deletes the messages in msg_list or the current message. |
u msg_list | Recalls deleted messages in msg_list. |
s msg_list +file | Appends messages (with headings) to file. |
w msg_list +file | Appends messages (text only) to file. |
pre msg_list | Keeps messages in the system mailbox. |
m addrlist | Creates and sends a new message to the addresses in addrlist. |
r msg_list | Sends a reply to senders and recipients of messages. |
R msg_list | Sends a reply only to senders of messages. |
a | Displays a list of aliases and their addresses. |
When the mail editor is processed it displays the mail editor prompt to indicate that it is waiting for input. At the prompt, you can enter any of the mail editor subcommands.
~q | Quits the editor without saving or sending the current message. |
~p | Displays the contents of the message buffer. |
~: mcmd | Runs a mailbox subcommand, (mcmd). |
EOT | Sends message (Ctrl-D on many terminals). |
. | Sends the current message. |
~d | Appends the contents of dead.letter to the message. |
~r filename | Appends the contents of filename to the message. |
~f numlist | Appends the contents of message numbers numlist. |
~m numlist | Appends and indents the contents of message numbers numlist. |
~e | Edits the message using the e editor (default is e). |
~v | Edits the message using the vi editor (default is vi). |
~w filename | Writes the message to filename. |
~! command | Starts a shell, runs command, and returns to the editor. |
~| command | Pipes the message to standard input of command and replaces the message with the standard output from that command. |
When the secret mail program processes a secret mailbox, it displays the secret mailbox prompt to indicate that it is waiting for input. The secret mailbox prompt is a question mark (?) displayed at the beginning of a new line. At the prompt, you can enter any of the secret mailbox subcommands.
xsend barbara | Addresses a message to the specified user. |
xget | Displays the secret mailbox. |
q | Quits, leaving unread messages. |
n | Deletes the current message and displays the next message. |
d | Deletes the current message and displays the next message. |
Return key | Deletes the current message and displays the next message. |
! | Executes a shell command. |
s | Saves the message in the named file or mbox. |
w | Saves the message in the named file or mbox. |