-->
Previous Table of Contents Next


mail......Send and Read Mail

mail option(s) users

PURPOSE

The mail command (also known in Linux as the mailx command) is used to send and receive electronic mail, either from other users on the system or users from the Internet at large (if your system has Internet capabilities).

Mail is only one of many electronic-mail options under Linux; virtually all distributions include the easier-to-use pine and elm programs, and other distributions include more advanced graphical mail tools.

EXAMPLES


$ mail

This displays your mail.


$ mail reichard@mr.net

This begins the process of sending electronic mail to reichard@mr.net.

OPTIONS

-b list Sends blind carbon copies to list, which is a comma-separated list of names.
-c list Sends copies to users in list.
-f file Uses mbox (or file, if specified) when launching mail; used as an alternative mailbox.
-i Ignores interrupt signals, which is useful when you’re using a Linux machine on a noisy dial-up line.
-I Forces interactive mode.
-n Doesn’t read /etc/mail.rc when starting.
-N Suppresses display of message headers when reading mail or editing a mail folder.
-s arg Uses arg as the subject of the mail message.
-v Works in verbose mode, where the details of delivery are displayed.
-num Displays the preceding message; if num is specified, then the num number of previous messages is printed.
? Displays a summary of commands.
!command Executes shell command.
alias (a) alias Prints all aliases if alias is not specified. If alias is specified, then information about that alias is listed. If multiple aliases are specified, a new one is created or an old one is changed.
alternates (alt) Manages accounts on multiple machines, informing you about the status of listed addresses or alternates.
chdir dir (c) Changes your current directory to dir. If no directory is specified, then the current directory changes to your home directory.
copy (co) Copies a message, but does not delete the original.
delete (d) Deletes messages.
dp, dt Deletes the current message and displays the next message.
edit (e) Launches text editor to edit message; after editing, the message is reentered into mail.
exit (ex or x) Quits mail without saving changes to the mailbox.
file (fi) Lists all folders in the folder directory.
folder (fo) Opens a new mail file or folder. If you don’t specify a new folder, the name of the current file is displayed. If you do switch to a new mail file or folder, the changes in the old mail file or folder will be written before switching. Shortcuts for the name of the new mail file or folder are:
# previous file
% system mailbox
%user user’s system mailbox
& your mbox file
+folder file in your folder directory
folders Lists all folders in the folder directory.
from (f) Prints message headers of messages.
headers (h) Lists the current range of headers, which is an 18-message group.
help Displays a summary of commands.
hold (ho, preserve) Marks messages that are to be stored in your system mailbox instead of in mbox.
ignore header Adds a header field to a list of fields to be ignored. If header is not specified, then the current list of fields to be ignored is displayed.
mail (m) user Sends mail to user; a list of users can also be specified.
mbox Moves messages to mbox when exiting. Default.
next (n) Displays next message in the sequence.
preserve (pre) Marks messages that are to be stored in your system mailbox instead of in mbox.
print list (p) Prints messages in list.
Print list (P) Prints list of files, as well as ignored header fields.
quit (q) Ends mail session, saving all undeleted, unsaved messages in the mbox file, preserving all messages marked with hold or preserve or never referenced in the system mailbox, and removing all other messages from the system mailbox.
reply (r) Composes a reply to the originator of the message and the other recipients.
Reply (R) Composes a reply to the originator of the message, but none of the other recipients.
respond Composes a reply to the originator of the message and the other recipients.
retain header Adds header to the list of fields named in retained_list, which are shown when you view a message.
save (s) Saves a message to a specific folder.
set (se) Displays all variables. If an argument is presented, it is used to set an option.
saveignore Removes ignored fields when saving a message.
saveretain Retains specified fields when saving a message.
shell (sh) Launches shell.
size Lists messages by size.
source file Reads commands from file.
top Displays the first five lines of a message.
type list (t) Prints messages in list.
Type (T) Prints list of files, as well as ignored header fields.
unalias Discards previous aliases.
undelete (u) Undeletes a message that was previously marked for deletion.
unread (U) Marks previously read messages as being unread.
unset Discards previous variables set with the set command.
visual (v) Launches visual editor and edits each message in a list.
write file (w) Writes the message body, without headers, to file.
xit (x) Quits mail without saving changes to the mailbox.
z Display next window of messages.
z- Displays previous window of messages.


Previous Table of Contents Next