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
-s
or--subject
: Specify the subject of the email message.-c
or--compose
: Compose a new email message.-r
or--read
: Read an existing email message.-d
or--delete
: Delete an email message.-f
or--folder
: Specify the folder to read or delete messages from.
Examples
-
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. -
Read a specific email message:
mail -r <message_number>
Replace
<message_number>
with the number of the message you want to read. -
Delete an email message:
mail -d <message_number>
Replace
<message_number>
with the number of the message you want to delete. -
Compose a new email message:
mail -c
This will open a text editor where you can compose a new email message.
Tips and Tricks
- You can use the
q
command to quit themail
program. - You can use the
h
command to display help information. - You can use the
l
command to list all email messages in the current folder. - You can use the
p
command to print an email message to the screen.
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.