Communicating with Other Users


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 5-14) displays a banner on the other user's terminal, saying that you are about to send a message.

Figure 5-14. The write utility I

$ write alex Hi Alex, are you there? o

The syntax of a write command line is


write username [terminal]

The username is the username of the user you want to communicate with. The terminal is an optional device name that is useful if the user is logged in more than once. You can display the usernames and device names of all users who are logged in on the local 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 username as the username. The write utility then copies text, line by line, from one keyboard/display to the other (Figure 5-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.

Figure 5-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

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 have to remember who is writing to you, however, 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, Jenny would have seen the following message:

$ 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").




A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

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