Read mail command line

The mail command!

The mail command is a command-line utility that allows you to read and manage your email messages. Here's a brief overview of how to use it:

Basic Syntax

mail [options] [username]

Options

Examples

  1. Read all new email messages:

    mail

    This will display a list of new email messages. You can then use the r command to read a specific message.

  2. Read a specific email message:

    mail -r <message_number>

    Replace <message_number> with the number of the message you want to read.

  3. Delete an email message:

    mail -d <message_number>

    Replace <message_number> with the number of the message you want to delete.

  4. Compose a new email message:

    mail -c

    This will open a text editor where you can compose a new email message.

Tips and Tricks

Note: The mail command is usually used in conjunction with a mail user agent (MUA) such as mutt or alpine. If you're using a modern email client, you may not need to use the mail command directly.