The Open Group Base Specifications Issue 7
IEEE Std 1003.1, 2013 Edition
Copyright © 2001-2013 The IEEE and The Open Group


talk - talk to another user


[UP] [Option Start] talk address [terminal][Option End]


The talk utility is a two-way, screen-oriented communication program.

When first invoked, talk shall send a message similar to:

Message from <unspecified string>
talk: connection requested by your_addresstalk: respond with: talk your_address

to the specified address. At this point, the recipient of the message can reply by typing:

talk your_address

Once communication is established, the two parties can type simultaneously, with their output displayed in separate regions of the screen. Characters shall be processed as follows:

Permission to be a recipient of a talk message can be denied or granted by use of the mesg utility. However, a user's privilege may further constrain the domain of accessibility of other users' terminals. The talk utility shall fail when the user lacks appropriate privileges to perform the requested action.

Certain block-mode terminals do not have all the capabilities necessary to support the simultaneous exchange of messages required for talk. When this type of exchange cannot be supported on such terminals, the implementation may support an exchange with reduced levels of simultaneous interaction or it may report an error describing the terminal-related deficiency.




The following operands shall be supported:

The recipient of the talk session. One form of address is the <user name>, as returned by the who utility. Other address formats and how they are handled are unspecified.
If the recipient is logged in more than once, the terminal argument can be used to indicate the appropriate terminal name. If terminal is not specified, the talk message shall be displayed on one or more accessible terminals in use by the recipient. The format of terminal shall be the same as that returned by the who utility.


Characters read from standard input shall be copied to the recipient's terminal in an unspecified manner. If standard input is not a terminal, talk shall write a diagnostic message and exit with a non-zero status.




The following environment variables shall affect the execution of talk:

Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
If set to a non-empty string value, override the values of all the other internationalization variables.
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). If the recipient's locale does not use an LC_CTYPE equivalent to the sender's, the results are undefined.
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output.
[XSI] [Option Start] Determine the location of message catalogs for the processing of LC_MESSAGES. [Option End]
Determine the name of the invoker's terminal type. If this variable is unset or null, an unspecified default terminal type shall be used.


When the talk utility receives a SIGINT signal, the utility shall terminate and exit with a zero status. It shall take the standard action for all other signals.


If standard output is a terminal, characters copied from the recipient's standard input may be written to standard output. Standard output also may be used for diagnostic messages. If standard output is not a terminal, talk shall exit with a non-zero status.








The following exit values shall be returned:

Successful completion.
An error occurred or talk was invoked on a terminal incapable of supporting it.



The following sections are informative.


Because the handling of non-printable, non- <space> characters is tied to the stty description of iexten, implementation extensions within the terminal driver can be accessed. For example, some implementations provide line editing functions with certain control character sequences.




The write utility was included in this volume of POSIX.1-2008 since it can be implemented on all terminal types. The talk utility, which cannot be implemented on certain terminals, was considered to be a "better" communications interface. Both of these programs are in widespread use on historical implementations. Therefore, both utilities have been specified.

All references to networking abilities (talking to a user on another system) were removed as being outside the scope of this volume of POSIX.1-2008.

Historical BSD and System V versions of talk terminate both of the conversations when either user breaks out of the session. This can lead to adverse consequences if a user unwittingly continues to enter text that is interpreted by the shell when the other terminates the session. Therefore, the version of talk specified by this volume of POSIX.1-2008 requires both users to terminate their end of the session explicitly.

Only messages sent to the terminal of the invoking user can be internationalized in any way:

The text in the STDOUT section reflects the usage of the verb "display" in this section; some talk implementations actually use standard output to write to the terminal, but this volume of POSIX.1-2008 does not require that to be the case.

The format of the terminal name is unspecified, but the descriptions of ps, talk, who, and write require that they all use or accept the same format.

The handling of non-printable characters is partially implementation-defined because the details of mapping them to printable sequences is not needed by the user. Historical implementations, for security reasons, disallow the transmission of non-printable characters that may send commands to the other terminal.




mesg, stty, who, write

XBD Environment Variables, General Terminal Interface


First released in Issue 4.

Issue 6

This utility is marked as part of the User Portability Utilities option.

End of informative text.


return to top of page

UNIX ® is a registered Trademark of The Open Group.
POSIX ® is a registered Trademark of The IEEE.
Copyright © 2001-2013 The IEEE and The Open Group, All Rights Reserved
[ Main Index | XBD | XSH | XCU | XRAT ]