Academic Computing Services * Simon Fraser University

HOW TO

Find out about others using Unix and "talk" to them

© July 29, 1996 B-9



Unix is a multi-user system. Many people can be (and usually are) logged in at the same time. It is possible to find out who else is currently logged in and even to communicate directly with another user.

Finding out who is logged in

The command who lists the SFU Computing ID of everyone who is currently logged in to the same host as you. For example, typing

who

might produce

jsmythe  ttyp1  Jul 25 10:13

bbrown   ttyp2  Jul 25 09:39

dlee     ttyp3  Jul 24 20:30

The first column shows the SFU Computing ID of each user. The next column displays the "terminal" the person is using; this information isn't useful. The last column shows the date and time the person logged in.

Finding out more about another user

To find out more about another ACS Unix user, use either the address_of command or the finger command. Each produces different information.

Using address_of

The address_of command is usually used to find a person's electronic mail address. It also gives you their SFU Computing ID, which you'll need in order to use the finger command most effectively.

To find the e-mail address and SFU Computing ID of Jane Doe, you would type

address_of jane doe

The result would look like

"Jane Doe"

Dept:  English

Email: jdoe@sfu.ca

       jane_doe@sfu.ca

Jane Doe's SFU Computing ID is jdoe and her e-mail address is either of the forms shown. You need not know the exact spelling of a person's name to use address_of. For more information about address_of and other ways to determine a person's e-mail address, see how-to M-2, Find someone's electronic mail address at SFU and elsewhere.

Using finger

If you know someone's SFU Computing ID, the finger command with the -m option will tell you more about them. Typing

finger -m jdoe

on Fraser might produce

Login name: jdoe           In real life: Jan Doe

Directory: /home/jdoe            Shell: /bin/csh

Last login at Fri Jul 2 10:13 from annex1.sfu.ca

Project: To learn more about Unix

Plan: To graduate by the year 2000

finger displays a person's SFU Computing ID, their name "in real life", their home directory, which Unix shell they use, the date and time they last logged in to the host (in this case, Fraser) and from where, and their project and plan (if they have these, see below). If the user is currently logged in to the host, finger will also show their idle time (the length of time since they last issued a command).

Note that if a person accesses their SFU Computing Account only from client e-mail programs like Eudora or Netscape, then finger will report that they have never logged in.

To have finger display information for your "Plan" and "Project", use a Unix editor like vi or emacs to create and edit two files in your home directory called .plan and .project. Note that the filenames must begin with a period. (For details on Unix editors, click here .) You'll also need to give others permission to read these files. To do this, type

chmod 644 .plan
chmod 644 .project

See how-to B-6, Permit Unix Files and Directories, for more information on the chmod command.

Finding out about users on other Unix systems

finger is capable of accessing remote systems; e.g., to find out about user jsmith on the cs.ubc.ca system, you would type

finger jsmith@cs.ubc.ca

Depending on the type of Unix system, finger may also report whether the user has any unread mail. (The reported last time that mail was read may not be accurate as it is affected by system programs for mail maintenance.)

For security or performance reasons, many Unix systems (including Fraser and Fraser) do not allow finger requests from other systems.

Finding out what other users are doing

The who and finger commands give information about who other users are, but not about what they are doing. The command w displays additional information about users currently logged in and about the host computer.

Here is a typical w display:

  2:47pm  up 8 days, 12:19,  26 users,  load average: 1.21, 2.00, 2.79

User   tty  from           login@  idle  JCPU   PCPU  what

jsmythe q4  dq21-nim2.sfu 12:54pm  1:05  3:27   1:32  elm

bbrown  q5  dq15-nim0.sfu  2:46pm  2:11  2:21   1:08  -csh

The first line shows the time, how long the system has been up, the number of users logged into the system, and the load averages (how "busy" the system is, averaged over 1, 5 and 15 minutes).

One line is displayed for each user currently logged in, showing their SFU Computing ID, the name of their "terminal", the host from which they are logged in, when they logged in, their idle time, the total CPU time used by that terminal so far (JCPU), and the CPU time used by the command now running (PCPU). The last column shows the command or process that the user is currently running.

Communicating with other users

Unix provides several ways to communicate with other users. Electronic mail is the most widely used mechanism. For more information on e-mail, click here .

Two other methods, write and talk, let you communicate directly with someone who is currently logged in. write and talk differ from e-mail because they send instant messages to a user who is currently logged in and they do not keep any record of the communication. Please be considerate of others when using write or talk to communicate with them.

Using write

When you know (by using the who command) that someone is logged in to the same host as you, you can send her/him an instant message by typing

write computingID

where computingID is the person's SFU Computing ID.

When you press Return, the other person will be notified that someone is contacting them (their screen may blink or they may hear a tone) and their screen will display

Message from jsmythe on ...

Each line that you type will appear on the recipient's screen, until you type the interrupt character (usually Control-c). This breaks the connection and allows the recipient to resume work on other tasks. The recipient may need to press Return to get the Unix command prompt % again.

Using talk

The write command allows only one-way communication between users on the same host. To set up a two-way exchange use the talk command. To initiate a conversation from Fraser with user bbrown on Fraser, user jdoe would type

talk bbrown@fraser.sfu.ca

The recipient would be notified and would see

Message from Talk_Daemon@fraser.sfu.ca ...
talk: connection requested by jdoe@fraser.sfu.ca.
talk: respond with: talk jdoe@fraser.sfu.ca

To establish the connection, the recipient types what is shown on the last line. In the example above, bbrown would type

talk jdoe@fraser.sfu.ca

Each person's screen is divided in half. Whatever you type appears on the top half of your screen and on the bottom half of the other person's screen until you press Return. When you've concluded your conversation, either party can break the connection by typing the interrupt character (usually Control-c).

Note that the talk protocol is architecture dependent, and sometimes doesn't work between different types of Unix hosts.

Preventing others from contacting you

If you don't want to be interrupted by someone trying to talk or write to you during your current login session, type

mesg n

Now if someone tries to talk to you they will see

[Your party is refusing messages]

If someone tries to write to you they will see

write: Permission denied

When you're ready to receive talk and write communications again, type

mesg y

If you can't remember how mesg is set, type

mesg

and Unix will reply with "is y" or "is n".

To permanently prohibit others from writing or talking to you, add the command

mesg n

to the initialization file .mycshrc in your home directory. For more information on .mycshrc, see how-to B-14, Customize Your Unix Environment.


* * * * * * * * * * * * * * *

This page written and maintained by Academic Computing Services, Simon Fraser University.
Please e-mail questions or comments to help@sfu.ca.