Network Administration: Linux Mail Console Client - dummies

Network Administration: Linux Mail Console Client

The most basic client for creating and reading e-mail is the mail command. Although it doesn’t have many advanced features, it is fast. So some Linux users like to use it for sending simple messages. (It is also sometimes used in scripts.)

To read mail, open a command console, log on using the account whose mail you want to read, and enter the command mail. A list of all messages in your mailbox will be displayed. You can then use any of the commands listed in the following table to work with the messages in the mailbox or compose new mail messages.

Mail Commands
Command Explanation
? Display a list of available commands.
q Quit.
h List the headers for all messages in the mailbox.
n Type the next message.
t list Type the specified messages. For example, t 3 types message 3
and t 4 5 types messages 4 and 5.
d list Deletes one or more messages. For example, d 4 deletes message
R list Reply to message sender.
r list Reply to message sender and all recipients.
m user Compose a new message addressed to the specified user.

To compose a new message from a command prompt, follow these steps:

  1. Type mail followed by the e-mail address of the recipient.

    For example:


    Mail responds by prompting you for the subject.

  2. Type the subject line and press Enter.

    Mail then waits for you to enter the text of the message.

  3. Type the message text. Use the Enter key to start new lines.

    You can enter as many lines as you wish for the message.

  4. Press Ctrl+D to finish the message.

    The following prompt will appear:

  5. Enter one or more carbon copy addresses if you want others to receive a copy. Otherwise, press Enter.

You’re done! The message is on its way.