Home > System Tutorial > LINUX > body text

Detailed explanation of how to use the mail command mail in CentOS

王林
Release: 2024-01-05 22:57:32
forward
1158 people have browsed it

1.Basic syntax of mail

h|headers Display the current mailing list

l|list displays the currently supported command list

?|help Display the usage of command parameters for multiple viewing mailing lists

d Delete the current email and move the pointer down. d 1-100 Delete emails 1 to 100

t|type|more|p|page num Read a certain email

n|next|{Fill in nothing} Read the content of the next email where the current pointer is; when reading, press the space bar to turn the page, and press the Enter key to move down one line

n|next|{Fill in nothing} num Read a certain email

f|from num View email header

top Display the email header of the email where the current pointer is located

file|folder displays the entire user email storage path and the number of emails

mail Write an email. After editing the text, press the Ctrl D key or the . key to end the text

q Exit

2. Email storage location:

/var/spool/mail/username

3. Three ways to send emails:

1). Standard input input email content:

mail -s "title" username@domain.c

Press Ctrl D key or . key to end the text

2).Pipeline method

echo “mail content”|mail -s “title” username@domain.c

cat somefile |mail-s "title" username@domain.c

3).File redirection method

mail -s "title" username@domain.c < file

The above is the detailed content of Detailed explanation of how to use the mail command mail in CentOS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!