Communication commands :

  • mail, mailx, nail, mutt, pine, mh (mail handler) - various mail client programs available on Unix/Linux systems. These offer various levels of ease of use and usefulness. We have already covered mutt, our choice of mail client.

  • write - write is a program that allows you to communicate directly to another user on the terminal they are logged in from. To invoke write, simple enter write recipient at the command prompt.

    You may now enter any text at the prompt. The message is entered one line at a time and can be several lines long. Only the current line may being entered may be modified using the [backspace], [ctrl]w, and [ctrl]u characters. Once you press [enter], the line is queued up for sending. When you have completed your message, press [ctrl]d (end of file) to transmit or [ctrl] c (interrupt) to cancel.

    You must invoke write each time you want to send additional message text.

    write sends messages directly to the screen even while the recipient is doing other tasks. As such, it is often considered a disruption. So, in general, don't use write if the recipient is not expecting it.

    If a recipient is logged on more than once, write will pick the 1st one it can contact unless you also indicate the terminal.

    Example :

    #( "who" shows that there are three logins, 2 by berezin, we wish to use write to send a message to berezin on pts/1 )

    who
    
    berezin  pts/1        2007-06-24 12:17 (192.168.2.90)
    berezin  pts/2        2007-06-24 12:15 (192.168.2.90)
    johnb    pts/3        2007-06-24 12:17 (192.168.2.90)
    
    write berezin pts/1
    my message [ctrl]d
    

  • talk - provides two way communication between terminals. talk is basically the original Internet messaging system.

    Invoke talk with the recipient's login id. The talk daemon will contact the recipient and instruct them to respond. If he/she does so, the screen for both users will split and allow you to type in one half of the screen while the recipient responds in the other.

    When done, terminate with [ctrl] d.

  • mesg - Like write, talk can be annoying to someone who is in the middle of a task. To prevent interruption from these commands, Unix supports the command mesg

    mesg n instructs the system to not allow another user to communicate with your terminal. And mesg y indicates that it is permissible. It is common to set mesg to no in your login configuration file to block write and talk. If you know someone wishes to communicate with you and you have the time, just run mesg y at the prompt.

    Command List