Linux Mail command usage
1. Send the file as an email
Syntax: Mail-s "topic" username @ address <File
For example:
Mail-s "program" User <file. C: file. c
Send the mail content to the user with the topic program.
2. send an email to the user of the system.
Syntax: Mail User Name
3. Send an email to a foreign user
Syntax: Mail username @ accept address
.../Usr/lib/sendmail-BP
...... "Mail queue is empty" ...... mail ....
For example:
Mailtest@hotmail.com
Subject: Mail Test
:
Enter Text Content
::
Press Ctrl + D or. to end the text.
Press Ctrl + C twice to interrupt the work. Do not send this letter.
CC (carbon copy): copy the text to another recipient.
4. Check whether the sent email is sent or stuck on the email server.
Syntax:/usr/lib/sendmail-BP
If "mail queue is empty" is displayed on the screen, mail has been sent.
Other error messages indicate that the email has not been sent for any reason.
How to view and read emails in Linux
All emails received by the system are saved in the "/var/spool/mail/[Linux User Name]" file.
In Linux, enter mail to go To the inbox and display the list of 20 emails.
The command prompt is "&"
Unread mark as unread mail
H | headers: displays the current mail list
L | List displays the list of currently supported commands
? | HELP command parameter usage for displaying multiple mail lists
D. Delete the current email, and move the pointer down. D 1-100 Delete 1st to 100 emails
F | from only displays the simple information of the current email. F num: displays the simple information of an email.
F | from num pointer to an email
Z displays the last 20 emails in the inbox.
More | p | when reading the email content of the current pointer on the page, press the Space key to flip the page, and press the Enter key to move down a row
T | type | more | p | PAGE num read an email
N | next | {do not fill in anything} read the content of the next email containing the current pointer
When reading, pressing the Space key is to flip the page, and pressing the Enter key is to move down a row
V | visual current mail enters the plain text editing mode
N | next | {do not fill in anything} num reads an email
Top displays the mail header of the email with the current pointer
File | Folder: displays the file of the system email and the total number of emails.
Exit the MAIL command platform and do not save the previous operations, such as deleting emails.
Q: log out of the mail command platform and save the previous operations. For example, if you delete an email that has been deleted by D, the read email will be transferred to the mbox file in the current user's home directory. If you delete a file in mbox, it will be permanently deleted.
On the Linux text command platform, enter mail-F mbox to view the emails in the mbox in the current directory.
CD changes the location of the current folder
When writing a letter, press Ctrl + C twice to stop working.
Press Ctrl + c once to exit reading.