系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > linux中mail命令

通過實(shí)例了解Linux mail命令的作用(2)

時(shí)間:2014-12-22 17:05:43 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20141222/33142.html 手機(jī)查看 評(píng)論

  在這里要說明一下的時(shí),如果我們的附件是不大的文本文件,我們有時(shí)也用不著發(fā)送附件,可以直接將附件的文本當(dāng)做郵件內(nèi)容發(fā)送,這樣通過郵件查看時(shí)也更方便些,如下:

  代碼如下:

  mail -s “this is a test” bbmonkey62@163.com 《 /home/hadoop/project/3.txt

  3、不用回車輸入郵件內(nèi)容發(fā)送郵件

  在上面的例子中,你如果照做的話,你會(huì)發(fā)現(xiàn)很不方便,那就是每次輸入郵件內(nèi)容都需要在命令運(yùn)行后回車輸入內(nèi)容,最后還要再按Ctrl+D完成。實(shí)際上,可以不用這么費(fèi)勁的,如下:

  代碼如下:

  echo “this is content” | mail -s “this is a title” bbmonkey62@163.com

  通過echo命令來輸入郵件內(nèi)容“this is content”,這樣就簡單多了!

  4、查看郵件

  通過mail命令也可以查看收到的郵件,這個(gè)我就簡單說一下吧,畢竟這個(gè)相對(duì)不常用,命令很簡單,直接輸入mail,會(huì)出現(xiàn)收到的郵件,每個(gè)郵件都對(duì)應(yīng)一個(gè)序列號(hào),如果要查看某封郵件,直接在?后輸入數(shù)字序列號(hào)即可。

  在?后輸入help可以查看所有的參數(shù),如下:

  代碼如下:

  ? help

  mail commands

  type 《message list》 type messages

  next goto and type next message

  from 《message list》 give head lines of messages

  headers print out active message headers

  delete 《message list》 delete messages

  undelete 《message list》 undelete messages

  save 《message list》 folder append messages to folder and mark as saved

  copy 《message list》 folder append messages to folder without marking them

  write 《message list》 file append message texts to file, save attachments

  preserve 《message list》 keep incoming messages in mailbox even if saved

  Reply 《message list》 reply to message senders

  reply 《message list》 reply to message senders and all recipients

  mail addresses mail to specific recipients

  file folder change to another folder

  quit quit and apply changes to folder

  xit quit and discard changes made to folder

 。 shell escape

  cd 《directory》 chdir to directory or home if none given

  list list names of all available commands《/p》 《p》A 《message list》 consists of integers, ranges of same, or other criteria

  separated by spaces. If omitted, mail uses the last message typed.

  在?后也可以直接輸入mail寫信哦,就跟上面的例子一樣,所不同的是,每步都會(huì)有提示,如下:

  代碼如下:

 。 mail

  To: bbmonkey62@163.com

  Subject: this is a title

  content

  EOT

  上面就是Linux中mail命令的用法介紹了,其實(shí)mail命令的用法還有很多,本文只是介紹了一些主要的用法,mail還可作為一個(gè)電子郵件程式,不過使用的人比較少。

標(biāo)簽 Mail 命令

發(fā)表評(píng)論

0

沒有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見解

立即評(píng)論

以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

官方交流群 軟件收錄