Main index

Introducing UNIX and Linux


Getting started

Overview
Using UNIX
      Usernames
      Logging in
Logging out
Commands
      Typing in commands
      Commands and options
Communication with other users
      Email
      Other communication facilities
Files
      The editor Vi
            Vi commands (command mode)
            Vi commands (colon mode)
      Other editors
Input and output
      Scripts
      Here-documents
      Pipes
      Making copies of input and output
      Pagers
Emergencies
Getting help
Summary
Exercises

Other communication facilities

Electronic mail is useful for sending messages, but not for holding a 'conversation', nor for sending urgent messages (since not all users will read mail very frequently). Two utilities are provided in UNIX to enable 'real-time' communication between logged in users. The first is write: suppose user sam is logged on, and you wish to send Sam a (short) message; use write sam followed by the lines of the message then ctrl-D.

write sam
Hi Sam.
It's coffee time

The message will be sent across line-by-line. Your message will appear on Sam's screen, preceded by a line telling sam who's sending the message:

Message from chris@box on ttyp9 at 14:42 ...
Hi Sam.
It's coffee time

If sam was logged on at several terminals at once (which is possible if Sam has multiple windows on a graphics display), you could specify the terminal the message should appear on, so:

write sam ttyp7

Sam can reply to you with the command write chris. Whatever sam is doing, the lines you type will appear on Sam's screen. It could be that the recipient of your message does not want this to happen (perhaps he or she is doing a complicated operation and doesn't wish to be disturbed). They can prevent messages being displayed by means of mesg. To deny other users permission to write messages to your screen, type mesg n. To reinstate permission, mesg y will reverse the effect of mesg n. If you try to write to a user who has denied you permission, you will simply get an error message. The second communications mechanism is talk. Rather than sending lines of messages, talk is the nearest you will come to actually talking to another user. It sends messages character-by-character as you type them in, and will work over networks. To run talk, the syntax is just as for write. After you have typed talk sam, a message will appear on Sam's terminal:

Message from chris@box
talk: connection requested by chris@box
talk: respond with: talk chris@box

When sam types talk chris@box (or whatever address talk specifies) both your screen and Sam's will be cleared, and divided into separate regions, one for each of you. When you press a key, it will appear in 'your' part of the screen, when Sam presses one the corresponding character will appear in 'their' part. You can use the DELETE key if you press a key by mistake. Your conversation will be terminated when either of you presses ctrl-C. Standard input and standard output are not the mechanisms employed by talk. Find a friend who is also logged in and experiment with write and talk.


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck