Unix Command: talk
About
This document provides an introduction to the Unix talk command. Additional information can be obtained via the Unix man page for talk by entering the following at the command line:
man talk
The Unix talk command allows two users to communicate in real time. The talk command may be invoked to connect users on the same machine or across the network - provided talk functionality is enabled on both machines and no hardware or software firewall is configured to block this access.
Usage
For communication with users on a remote machine, the user must provide the name of the remote user and machine to the talk command in the format <username>@<machine>. For example, if you wish to set up a talk session with user jon on machine workstation27, you would enter the following command:
talk jon@workstation27
For users on the local machine, one need only provide the user account name:
talk jon
Once you have initiated a talk request to another user, that user must respond with
their own talk request ( talk <your_name>@<your_machine> ) in order to complete the connection.
If you do not wish to receive talk requests from other users, simply disable messages
via the mesg command:
mesg n
If you wish to always suppress messages from all users, consider adding the above to your .profile or shell config file (in bash, your rc - short for "run commands" - file is likely ~/.bashrc ).
Advanced Options
In the event a user is logged in to the system on more than one terminal (or virtual terminal), you may additionally pass a ttyname to the command:
talk jon@workstation27 tty005
To determine the status of various users on the system, you may use the who command, which will show all users. By passing the -T option to the who command, you can view a list of all users on the system as well as their message status. A plus sign (+) next to a name means they are available to chat, whereas a minus sign (-) indicates they are not.
[kmetcalf@voyager ~]$ who -T
joe | console | May | 1 | 12:07 | |
sam | ttys000 | May | 1 | 12:07 | (workstation1) |
root | ttys001 | May | 1 | 12:19 | |
mary | ttys002 | May | 1 | 12:10 | |
super | ttys003 | May | 1 | 13:49 | (10.168.9.99) |
Note that the workstation and the IP Address in the above example indicate that the user is logged in from a remote system.
More information
Additional information regarding the talk command may be found via the unix man page (man talk) or online. Additionally, a Google search for the term "Unix man talk" returns more results than can be read in a single lifetime.
Copyright and Audience
This page is indented to serve as reference material for the CIS 18A (Intro to Unix/Linux) class at De Anza College.
An Introduction Unix Commands: talk by Kevin Metcalf is licensed under a Creative Commons Attribution 3.0 Unported License.