mail—mail, rmail—reads mail or send mail to users

Sending mail
   mail [ –tw ] [ –m message_type ] recipient…
   rmail [ –tw ] [ –m message_type ] recipient…
Reading mail
   mail [ –ehpPqr ] [ –f filename ]
Forwarding mail
   mail –F recipient…
Debugging
   mail [ –x debug_level ] [ other_mail_options ] recipient…
   mail [ –T mailsurr_file ] recipient…

A recipient is usually a username recognized by login(1). When recipients are named, mail assumes a message is being sent. It reads from the standard input up to an end-of-file (Ctrl-D), or if reading from a terminal, until it reads a line consisting of just a period. When either of those indicators is received, mail adds the letter to the mailfile for each recipient.

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.