Topics Map > University of Chicago > IT Services > Applications, Operating Systems, & Devices

Basic Unix - Communicating with Others

This article describes how to communicate with others in the Unix operating system.

Anyone on a shared Unix system may communicate with other users who are logged in at the same time. Using electronic mail, you can also reach other users on those systems who are not logged in, as well as users on other campus computers, and computers all over the world. Some of these systems allow for real-time communication as well (using `talk', for instance).

There are several commands for finding who else is logged in and what they're doing. These include:

 users show a simple list of which usernames are logged in
w list which users are logged in, when they logged in, and what programs they're running
finger provide names of users currently on, when they logged in, and where they logged in from

Experiment with all of these commands to see which you find most useful.

finger

The 'finger' command has far more uses than simply displaying a list of people logged in. It's more commonly used to learn more about an individual user of the system:

 > finger demo
Login name: demo In real life: Demo Account
Directory: /nfs/harper/h2/demo Shell: /usr/local/bin/tcsh
Last login Tue Jan 26 10:18 on ttyp7 from somewhere.uchi
New mail received Wed Jan 27 16:51:02 1993;
unread since Tue Jan 26 17:50:41 1993
Project: Demos. What else.
Plan:
To figure out what a plan is.

Many people 'finger' friends just to see the "New mail received...unread since..." statistics.

You should be aware that the "Last login" field refers only to the system  you happen to be on: if "demo" generally logs in on harper, and you finger demo on harper, the "Last login" and when-mail-was-read statistics won't make sense. You may even see the message "Never logged in" instead of "Last login...", if your target habitually uses a machine other than the one you're on. To get around this problem, finger people on the machines they use most often: "finger myfriend@harper", for example.

(Your correspondents outside the University, knowing your email address is "someone@midway.uchicago.edu", may try to finger you at midway. This will fail; for security reasons, midway does not respond to finger requests. So you may want to tell your friends to finger you at the machine you normally use -- harper.)

chfn; .project/.plan files

To change your "finger name" -- the "In real life:" field above -- use the `chfn' command.

If you want to have a "Project" and "Plan" of your own, create files in your home directory called ".project" (this should be one line long) and ".plan". Don't forget that the names should begin with a dot. Both files need to be publicly readable, and your home directory must be publicly executable.

Sending messages to other terminals

write

The 'write' utility is the simplest form of communication on a Unix system. If "friendsname" is logged in to the same machine you're on (also on harper, for instance), you can type

 > write friendsname

then a single-line message, which you can end by pressing the return key and typing a Control-D.

The person you've written to will see a message like this on their screen:

 Message from example@harper on ttye1 at 0:01 ...
This is a simple 'write' message.
EOF

talk (and ntalk)

Using the talk utility, you can communicate interactively with someone else who is currently logged in, even on a different machine. Invoke 'talk' like this:

> talk destination-user optional-terminal

where "destination-user" is the username of the person you're sending the message, and a terminal name is optional (if the person you want to communicate with is logged in on more than one terminal, you must specify the one you want; usually you can leave it out). To send a message to a friend logged into harper as "user," say:

> talk user@harper

After issuing this command line you will get the following responses:

 [No connection yet]
[Waiting for your party to respond]

If the intended person does not answer immediately, 'talk' will display the messages:

 [Waiting for your party to respond]
[Ringing your party again]

until your correspondent responds. Once you establish contact, you will be able to type your message at the same time as your correspondent, and both messages will be displayed on the screen simultaneously, your message in the top half of the screen and your correspondent's in the bottom half.

If the person you are trying to contact does not respond, you can exit the program by entering a Control-C.

You may also be the object of an intended communication. If someone tries to communicate with you, a message similar to the one below will appear on your screen.

 Message from Talk_Daemon@harper.UChicago.edu. at 15:59
... talk: connection requested byafriend@harper.UChicago.edu.
talk: respond with: talkafriend@harper.UChicago.edu.

To complete the communication with your friend, say

> talkafriend@harper

When your correspondent is ready to talk, 'talk' will notify you, and the communication can take place. To exit the program when you are finished talking, enter a Control-C, and you will receive the message

[Connection closing. Exiting]

then be returned to your Unix prompt.

The version of talk running on our systems is not compatible with everyone else's version of 'talk'. If 'talk' doesn't work for you with a friend on a different system, try 'ntalk' instead; while `ntalk' works with some systems that `talk' does not, the two commands function in exactly the same way.

'mesg n'

Occasionally, you'll see the notation "(messages off)" when you finger someone. Or you'll attempt to use 'talk' or 'write' and get this response:

[Your party is refusing messages]

This means the person has issued the command 'mesg n', which prevents messages to a terminal. If you find yourself being constantly interrupted by such messages, you may want to use the command yourself. (To turn permission to your terminal back on, say 'mesg y'.)

Messages to a terminal from unknown users can be rather disturbing. If you're a stranger to someone, it's generally considered polite to send electronic mail before using 'talk' or 'write' to contact them.

Electronic mail

If the intended recipients of your messages are not currently logged in, you must use electronic mail (email) to communicate with them. Using email software, you can send, receive and read personal mail.

You may also use email to communicate with most of the shared systems which are connected to the campus network, and hundreds of thousands of computers outside of the uchicago.edu domain.

Two common email programs for the command line exist: `mail' (a standard Unix utility) and the much more powerful and friendly `pine ' (the package is not usually installed with the core). You may use either to send mail without running into problems (aside from any extra difficulty in learning two programs). But the two programs store incoming messages in incompatible formats, so you should settle on one or the other to read your mail.

mail

The simplest way to send mail to someone with the username "someone" is to type:

> mail someone

You can mail to several different people at the same time by specifying several usernames, separated by spaces.

When the `mail' utility starts up, you will be prompted for a subject line. Once you provide one (and press the return key), you can enter your message. When you have finished the message, you can exit mail in one of two ways: by issuing the end-of-file character (Control-D); or by typing a period ('.') as the first character of the last line. When you exit, you will be prompted for 'Cc:', at which point you can enter any usernames you forgot to include in the original command line, or your own username (for your very own personal "carbon copy").

You can also use `mail' to read mail you have received. If you have received mail, you will be notified when you log in. You may then call up mail by entering

> mail

to read new incoming messages.

Reading old messages, stored in the file "mbox" in your home directory, is also easy:

> mail -f mbox



Keywords:communicate finger chfn ntalk mesg   Doc ID:16197
Owner:Larry T.Group:University of Chicago
Created:2010-12-08 18:00 CSTUpdated:2015-09-03 06:11 CST
Sites:University of Chicago, University of Chicago - Sandbox
Feedback:  25   6