Communicating with Other Users

 < Day Day Up > 

The utilities discussed in this section exchange messages and files with other users either interactively or through email.

write: Sends a Message

The write utility sends a message to another user who is logged in. When you and another user use write to send messages to each other, you establish two-way communication. Initially a write command (Figure 3-14) displays a banner on the other user's terminal, saying that you are about to send a message.

The syntax of a write command line is

 write username [terminal] 

Figure 3-14. The write utility I
 $ write alex Hi Alex, are you there? o 

Figure 3-15. The write utility II
 $ write alex Hi Alex, are you there? o Message from alex@bravo.example.com on pts/0 at 16:23 ... Yes Jenny, I'm here. o 

The username is the login name of the user you want to communicate with. The terminal is an optional terminal name that is useful if the user is logged in more than once. You can display the login and terminal names of the users who are logged in on your system by using who, w, or finger.

To establish two-way communication with another user, you and the other user must each execute write, specifying the other's login name as the username. The write utility then copies text, line by line, from one keyboard/display to the other (Figure 3-15). Sometimes it helps to establish a convention, such as typing o (for over) when you are ready for the other person to type and typing oo (for over and out) when you are ready to end the conversation. When you want to stop communicating with the other user, press CONTROL-D at the beginning of a line. Pressing CONTROL-D tells write to quit, displays EOF (end of file) on the other user's terminal, and returns you to the shell. The other user must do the same.

If the Message from... banner appears on your screen and obscures something you are working on, press CONTROL-L or CONTROL-R to refresh the screen and remove the banner. Then you can clean up, exit from your work, and respond to the person who is writing to you. You just have to remember who is writing to you, because the banner will no longer appear on the screen.

mesg: Denies or Accepts Messages

Give the following command when you do not wish to receive messages from another user:

 $ mesg n 

If Alex had given this command before Jenny tried to send him a message, she would have seen the following:

 $ write alex Permission denied 

You can allow messages again by entering mesg y. Give the command mesg by itself to display is y (for yes, messages are allowed) or is n (for no, messages are not allowed).

     < Day Day Up > 


    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net